From 8ab9daf2803504edbd49f9c97a7f2eb484f15747 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Wed, 31 Aug 2016 14:46:40 -0400 Subject: Include user defined attributes in inspect The fact that this only includes column names is an oversight. --- activerecord/lib/active_record/core.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/core.rb') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 2725c85446..4628d7fb16 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -500,7 +500,7 @@ module ActiveRecord # We check defined?(@attributes) not to issue warnings if the object is # allocated but not initialized. inspection = if defined?(@attributes) && @attributes - self.class.column_names.collect do |name| + self.class.attribute_names.collect do |name| if has_attribute?(name) "#{name}: #{attribute_for_inspect(name)}" end -- cgit v1.2.3