# File lib/her/model/attributes.rb, line 71 def assign_attributes(new_attributes) if !new_attributes.respond_to?(:to_hash) raise ArgumentError, "When assigning attributes, you must pass a hash as an argument." end # Coerce new_attributes to hash in case of strong parameters new_attributes = new_attributes.to_hash @_her_attributes ||= attributes # Use setter methods first unset_attributes = self.class.use_setter_methods(self, new_attributes) # Then translate attributes of associations into association instances associations = self.class.parse_associations(unset_attributes) # Then merge the associations into @_her_attributes. @_her_attributes.merge!(associations) end