liveh2o / active_remote

Active Remote provides Active Record-like object-relational mapping over RPC. It's Active Record for your platform.
MIT License
63 stars 23 forks source link

Use Active Model attributes #72

Closed liveh2o closed 5 years ago

liveh2o commented 5 years ago

Now that Active Model 5+ is required, we can pull in the attributes behavior from ActiveModel::Model. This adds translation support, and now raises exceptions when assigning unknown attributes.

To accommodate the fact that not all fields from RPC responses are defined as attributes, create/update methods have been updated to use instantiate instead of assign_attributes since it safely works around the unknown attributes error by only capturing known attributes.