Groups
Sign in
Groups
DataMapper
Conversations
About
Send feedback
Help
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 PM
3/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
3/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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