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 @records
end end
# Serializes the relation objects Array.
def encode_with(coder)
coder.represent_seq(nil, to_a)
end
def as_json(options = nil) #:nodoc: def as_json(options = nil) #:nodoc:
to_a.as_json(options) to_a.as_json(options)
end end

View file

@ -119,10 +119,6 @@ module ActiveRecord
arel.respond_to?(method, include_private) arel.respond_to?(method, include_private)
end end
def encode_with(coder)
coder.represent_seq(nil, to_a)
end
protected protected
def array_delegable?(method) def array_delegable?(method)