lib/toy/inspect.rb in toystore-0.13.0 vs lib/toy/inspect.rb in toystore-0.13.1
- old
+ new
@@ -2,24 +2,23 @@
module Inspect
extend ActiveSupport::Concern
module ClassMethods
def inspect
- keys = attributes.keys - ['id']
+ keys = attributes.keys
nice_string = keys.sort.map do |name|
type = attributes[name].type
"#{name}:#{type}"
end.join(" ")
- "#{name}(id:#{attributes['id'].type} #{nice_string})"
+ "#{name}(#{nice_string})"
end
end
def inspect
- keys = self.class.attributes.keys - ['id']
+ keys = self.class.attributes.keys
attributes_as_nice_string = keys.map(&:to_s).sort.map do |name|
"#{name}: #{read_attribute(name).inspect}"
end
- attributes_as_nice_string.unshift("id: #{read_attribute(:id).inspect}")
"#<#{self.class}:#{object_id} #{attributes_as_nice_string.join(', ')}>"
end
end
end