Ruby 2.0 breaks Model.get with string, which works in 1.9

15 views
Skip to first unread message

Tony Pitale

unread,
Mar 16, 2014, 6:34:47 PM3/16/14
to datam...@googlegroups.com
class User
  include DataMapper::Resource

  property :id, Serial
end

User.create

User.first #=> works
User.get(1) #=> works
User.get("1") #=> works

# Switch to Ruby 2.0.0+

User.get("1") #=> does NOT work

# Why?

christian

unread,
Mar 19, 2014, 1:00:10 PM3/19/14
to datam...@googlegroups.com
irb(main):002:0> Offer.get '1'
 ~ (0.079982) SELECT "id" FROM "offers" WHERE "id" = 1 LIMIT 1
=> #<Offer @id=1>
irb(main):002:0> RUBY_VERSION
=> "2.0.0"
irb(main):003:0> DataMapper::VERSION
=> "1.2.1"

I guess you need to provide more info to reproduce it.

-christian

Reply all
Reply to author
Forward
0 new messages