From 63961069bb23f82d86e836188a680a5babaa716c Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Wed, 16 Jul 2014 23:31:30 +0400 Subject: [PATCH] Fix new ActiveRecord::Relation instance presentation for Rails>=4 --- lib/awesome_print/ext/active_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awesome_print/ext/active_record.rb b/lib/awesome_print/ext/active_record.rb index b15f3c6..27812dc 100644 --- a/lib/awesome_print/ext/active_record.rb +++ b/lib/awesome_print/ext/active_record.rb @@ -21,7 +21,7 @@ module AwesomePrint cast = :active_record_instance elsif object.is_a?(Class) && object.ancestors.include?(::ActiveRecord::Base) cast = :active_record_class - elsif type == :activerecord_relation + elsif type == :activerecord_relation || object.class.ancestors.include?(::ActiveRecord::Relation) cast = :array end cast