lib/active_model/serializers/json.rb in activemodel-4.1.16 vs lib/active_model/serializers/json.rb in activemodel-4.2.0.beta1
- old
+ new
@@ -8,11 +8,11 @@
include ActiveModel::Serialization
included do
extend ActiveModel::Naming
- class_attribute :include_root_in_json, instance_writer: false
+ class_attribute :include_root_in_json
self.include_root_in_json = false
end
# Returns a hash representing the model. Some configuration can be
# passed through +options+.
@@ -91,10 +91,10 @@
else
include_root_in_json
end
if root
- root = self.class.model_name.element if root == true
+ root = model_name.element if root == true
{ root => serializable_hash(options) }
else
serializable_hash(options)
end
end