aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-16 15:44:01 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-16 15:44:01 -0300
commitdf8b021102d96e5ccadc9a633e846bb33c8466c6 (patch)
tree9bdd07a478f504602b43ddfd5e750c0a4ce97487 /activerecord/lib
parent90f0cdc906fcec77937363c87cba45f3802ac858 (diff)
parentef8cae60ee330f760e35f7c2ed9497b6918587f9 (diff)
downloadrails-df8b021102d96e5ccadc9a633e846bb33c8466c6.tar.gz
rails-df8b021102d96e5ccadc9a633e846bb33c8466c6.tar.bz2
rails-df8b021102d96e5ccadc9a633e846bb33c8466c6.zip
Merge pull request #16183 from goddamnhippie/fix-psych-warning
Implement required #encode_with
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index cef40be7ce..ad54d84665 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -242,6 +242,11 @@ module ActiveRecord
@records
end
+ # Serializes the relation objects Array.
+ def encode_with(coder)
+ coder.represent_seq(nil, to_a)
+ end
+
def as_json(options = nil) #:nodoc:
to_a.as_json(options)
end