Permalink
Browse files

Force id to be an Integer

  • Loading branch information...
1 parent b5cec8a commit 338f10478d8a1aa5b67cd9aecb2c7770b3954945 @tpope tpope committed Mar 4, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/pickler/tracker.rb
View
@@ -97,7 +97,10 @@ def self.accessor(*methods)
define_method("#{method}=") { |v| @attributes[method.to_s] = v }
end
end
- reader :id
+
+ def id
+ id = @attributes['id'] and Integer(id)
+ end
def to_xml(options = nil)
@attributes.to_xml({:dasherize => false, :root => self.class.name.split('::').last.downcase}.merge(options||{}))

0 comments on commit 338f104

Please sign in to comment.