diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-06-28 20:16:06 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-07-03 21:38:13 -0500 |
commit | e3d6d10e1ff669430c3d8678c196c52397c850ea (patch) | |
tree | b501fddd7ccc4ad4eb3b7d2666761581d6f4dbe5 | |
parent | a4bdc00fec623f72592e663e6d7830eea0bc6ea4 (diff) | |
download | rails-e3d6d10e1ff669430c3d8678c196c52397c850ea.tar.gz rails-e3d6d10e1ff669430c3d8678c196c52397c850ea.tar.bz2 rails-e3d6d10e1ff669430c3d8678c196c52397c850ea.zip |
Ensure JSON serializer includes model naming
-rw-r--r-- | activemodel/lib/active_model/serializers/json.rb | 2 | ||||
-rw-r--r-- | activemodel/test/cases/json_serialization_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index 60b5cbe948..440fe47e34 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -10,6 +10,8 @@ module ActiveModel include ActiveModel::Attributes included do + extend ActiveModel::Naming + cattr_accessor :include_root_in_json, :instance_writer => false end diff --git a/activemodel/test/cases/json_serialization_test.rb b/activemodel/test/cases/json_serialization_test.rb index abcec67a85..e50922493d 100644 --- a/activemodel/test/cases/json_serialization_test.rb +++ b/activemodel/test/cases/json_serialization_test.rb @@ -2,7 +2,6 @@ require 'cases/helper' class JsonSerializationTest < ActiveModel::TestCase class Contact - extend ActiveModel::Naming include ActiveModel::Serializers::JSON attr_accessor :name, :age, :created_at, :awesome, :preferences end |