Skip to content

Apply entity builder on setter. #30

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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