diff options
author | Gustavo Beathyate <gustavo.bt@me.com> | 2014-07-15 18:01:16 -0500 |
---|---|---|
committer | Gustavo Beathyate <gustavo.bt@me.com> | 2014-07-15 18:01:16 -0500 |
commit | ef8cae60ee330f760e35f7c2ed9497b6918587f9 (patch) | |
tree | 4aac50dfec5143943c615804ab896bb26148628c | |
parent | b8e8096a89b0405544c8004c9c445a7894cf7ec9 (diff) | |
download | rails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.tar.gz rails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.tar.bz2 rails-ef8cae60ee330f760e35f7c2ed9497b6918587f9.zip |
Move #encode_with to Relation
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 4 |
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) |