Permalink
Browse files

fix issue #373

  • Loading branch information...
1 parent 9aba10d commit 74a76e50f0191ab65461c57c1a78693e7bd1fe59 @kkamil committed Feb 12, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/mongo_mapper/plugins/inspect.rb
@@ -7,11 +7,7 @@ module Inspect
def inspect(include_nil = false)
keys = include_nil ? key_names : attributes.keys
attributes_as_nice_string = keys.sort.collect do |name|
- if self[name].nil?
- "#{name}: #{self.send(:"#{name}").inspect}"
- else
- "#{name}: #{self[name].inspect}"
- end
+ "#{name}: #{(self[name] || self.send(:"#{name}")).inspect}"
end.join(", ")
"#<#{self.class} #{attributes_as_nice_string}>"
end

0 comments on commit 74a76e5

Please sign in to comment.