Browse files

Merge pull request #4563 from amatsuda/ar_relation_pp

let AR::Relation pretty_printed like an Array
  • Loading branch information...
2 parents e6c9902 + 1c49b61 commit 47addcce372c8cd488fd3b70fb3ebb89a91a9987 @tenderlove tenderlove committed Jan 23, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 activerecord/lib/active_record/relation.rb
View
4 activerecord/lib/active_record/relation.rb
@@ -496,6 +496,10 @@ def inspect
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)

0 comments on commit 47addcc

Please sign in to comment.