aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2013-11-05 19:22:03 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2013-11-05 19:22:03 -0800
commit134c1156dd5713da41c62ff798fe3979723e64cc (patch)
tree6e7f9540dafbec02d4ca6c2a7e75c637d86e1f1c /actionpack/lib/action_controller
parent44406d1e77061ce22effaae4698918c1f9f6271a (diff)
downloadrails-134c1156dd5713da41c62ff798fe3979723e64cc.tar.gz
rails-134c1156dd5713da41c62ff798fe3979723e64cc.tar.bz2
rails-134c1156dd5713da41c62ff798fe3979723e64cc.zip
Fixed Object#as_json and Struct#as_json with options
These methods now takes the same options as Hash#as_json, for example: struct = Struct.new(:foo, :bar).new struct.foo = "hello" struct.bar = "world" json = struct.as_json(only: [:foo]) # => {foo: "hello"} This is extracted from PR #11728 from @sergiocampama, see also the discussion in #11460.
Diffstat (limited to 'actionpack/lib/action_controller')
0 files changed, 0 insertions, 0 deletions