From ef8cae60ee330f760e35f7c2ed9497b6918587f9 Mon Sep 17 00:00:00 2001 From: Gustavo Beathyate Date: Tue, 15 Jul 2014 18:01:16 -0500 Subject: Move #encode_with to Relation --- activerecord/lib/active_record/relation.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib/active_record/relation.rb') 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 -- cgit v1.2.3