1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move #encode_with to Relation

This commit is contained in:
Gustavo Beathyate 2014-07-15 18:01:16 -05:00
parent b8e8096a89
commit ef8cae60ee
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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)