diff options
author | Xinjiang Lu <xinjiang.lu@gmail.com> | 2013-05-12 12:10:02 -0400 |
---|---|---|
committer | Xinjiang Lu <xinjiang.lu@gmail.com> | 2013-05-15 20:22:18 -0400 |
commit | ec55866e398feb1a52701027ab86857b62622ab6 (patch) | |
tree | 1ec15a25f77abf0f04efdd64a4d38fe7cc2f97e0 /activeresource/lib | |
parent | 5919a552e4e4203b8d5eb5234428bc00dd462c49 (diff) | |
download | rails-ec55866e398feb1a52701027ab86857b62622ab6.tar.gz rails-ec55866e398feb1a52701027ab86857b62622ab6.tar.bz2 rails-ec55866e398feb1a52701027ab86857b62622ab6.zip |
Support include_root_in_json for ActiveResource properly.
This commit is a backport from
https://github.com/rails/activeresource/pull/29. The
ActiveResource's include_root_in_json option is broken for 3.2.x.
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 032a245c3c..f9cc7d03c8 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -1336,7 +1336,7 @@ module ActiveResource end def to_json(options={}) - super({ :root => self.class.element_name }.merge(options)) + super(include_root_in_json ? { :root => self.class.element_name }.merge(options) : options) end def to_xml(options={}) |