Skip to content

Apply entity builder on setter. #30

@guisouza

Description

@guisouza

Guys I really hope I am wrong, but i think we are not applying entity builders on setter, but only on entity construction ..

Is this the expected behaviour ? or it is a bug ?

@albertossilva could you please check, i have a fix for it, like this :

    set: function (value){
      if (instance.schema[field].type || instance.schema[field].builder) {
        value = instance.applyEntityConstructor(instance.schema[field], value);
      }
      if(instance.data[field] !== value) {
        instance.data[field] = value;
        return instance._validate();
      }
    },

should I submit the PR ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions