module Her::Model::Parse
This module handles resource data parsing at the model level (after the parsing middleware)
Public Instance Methods
saved_attributes()
click to toggle source
# File lib/her/model/parse.rb, line 16 def saved_attributes simple_attributes = attributes.except(*self.class.association_names.map(&:to_s)) simple_attributes.merge(saved_nested_attributes) end
to_params()
click to toggle source
Convert into a hash of request parameters, based on `include_root_in_json`.
@example
@user.to_params # => { :id => 1, :name => 'John Smith' }
# File lib/her/model/parse.rb, line 12 def to_params self.class.to_params(self.saved_attributes, self.changes) end