strongloop/loopback-datasource-juggler — pull request #78 by pandaiolo (2014-02-26 20:15:13+00:00)
Title: Fix, model builder setter will not try to cast value if already the proper type

Data source juggler can deal with many different type of data, coming from datasource connectors.

In the model definition, each property can be defined with its type, which , in the end, will drive the behavior of the default setter.

When a value is back from the connector source, it will be casted to this type, to keep model typing correct.

This fix adds a check on that value in case the returned value is already of the property type. In this case, it will just pass the value as is.

This avoid errors to be thrown by type constructors that cannot convert themselves.