diff options
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 19a2720913..5b21e01dcc 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -498,14 +498,15 @@ 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 { |name| + self.class.column_names.collect do |name| if has_attribute?(name) "#{name}: #{attribute_for_inspect(name)}" end - }.compact.join(", ") - else - "not initialized" - end + end.compact.join(", ") + else + "not initialized" + end + "#<#{self.class} #{inspection}>" end |