This blog is part of our Rails 5 series.
Before Rails 5, we could use
assign_attributes and have bulk assignment of attributes
only for objects whose classes are inherited from
In Rails 5 we can make use of
assign_attributes method and have bulk assignment of attributes
even for objects whose classes are not not inherited from
This is possible because the attributes assignment code
is now moved from
To have this up and running, we need to include
ActiveModel::AttributeAssignment module to our class.