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

let AR::Relation pretty_printed like an Array

This commit is contained in:
Akira Matsuda 2012-01-21 06:45:55 +09:00
parent 983bf6d456
commit 1c49b61d96

View file

@ -496,6 +496,10 @@ module ActiveRecord
to_a.inspect
end
def pretty_print(q)
q.pp(self.to_a)
end
def with_default_scope #:nodoc:
if default_scoped? && default_scope = klass.send(:build_default_scope)
default_scope = default_scope.merge(self)