Module: Her::Model::Parse
Overview
This module handles resource data parsing at the model level (after the parsing middleware)
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #saved_attributes ⇒ Object
-
#to_params ⇒ Object
Convert into a hash of request parameters, based on ‘include_root_in_json`.
Instance Method Details
#saved_attributes ⇒ Object
16 17 18 19 |
# 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 ⇒ Object
Convert into a hash of request parameters, based on ‘include_root_in_json`.
12 13 14 |
# File 'lib/her/model/parse.rb', line 12 def to_params self.class.to_params(self.saved_attributes, self.changes) end |