method
from_json
v3.2.13 -
Show latest stable
- Class:
ActiveModel::Serializers::JSON
from_json(json, include_root=include_root_in_json)public
No documentation available.
# File activemodel/lib/active_model/serializers/json.rb, line 100
def from_json(json, include_root=include_root_in_json)
hash = ActiveSupport::JSON.decode(json)
hash = hash.values.first if include_root
self.attributes = hash
self
end