aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGustavo Beathyate <gustavo.bt@me.com>2014-07-15 18:01:16 -0500
committerGustavo Beathyate <gustavo.bt@me.com>2014-07-15 18:01:16 -0500
commitef8cae60ee330f760e35f7c2ed9497b6918587f9 (patch)
tree4aac50dfec5143943c615804ab896bb26148628c /activerecord
parentb8e8096a89b0405544c8004c9c445a7894cf7ec9 (diff)
downloadrails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.tar.gz
rails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.tar.bz2
rails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.zip
Move #encode_with to Relation
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation.rb5
-rw-r--r--activerecord/lib/active_record/relation/delegation.rb4
2 files changed, 5 insertions, 4 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
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb
index df3ac43b0a..50f4d5c7ab 100644
--- a/activerecord/lib/active_record/relation/delegation.rb
+++ b/activerecord/lib/active_record/relation/delegation.rb
@@ -119,10 +119,6 @@ module ActiveRecord
arel.respond_to?(method, include_private)
end
- def encode_with(coder)
- coder.represent_seq(nil, to_a)
- end
-
protected
def array_delegable?(method)