def to_params(attributes, changes = {})
filtered_attributes = attributes.each_with_object({}) do |(key, value), memo|
case value
when Her::Model
when ActiveModel::Serialization
value = value.serializable_hash.symbolize_keys
end
memo[key.to_sym] = value
end
filtered_attributes.merge!(embeded_params(attributes))
if her_api.options[:send_only_modified_attributes]
filtered_attributes.slice! *changes.keys.map(&:to_sym)
end
if include_root_in_json?
if json_api_format?
{ included_root_element => [filtered_attributes] }
else
{ included_root_element => filtered_attributes }
end
else
filtered_attributes
end
end