
can't query boolean = false
Reported by Paul Meserve | July 20th, 2009 @ 10:31 AM | in 0.10.0
require 'rubygems'
require 'dm-core'
class User
include DataMapper::Resource
property :id, Serial
property :flag, Boolean
end
DataMapper.setup(:default, "sqlite3::memory:")
User.auto_migrate!
User.create(:flag => true)
User.create(:flag => false)
User.all # => [#<User @id=1 @flag=true>, #<User @id=2 @flag=false>]
User.all(:flag => true) # => [#<User @id=1 @flag=true>]
User.all(:flag => false) # => []
Looking at the query log, it looks like no query is ever executed if a search is done for false on a boolean property
Comments and changes to this ticket
-
Dan Kubb (dkubb) July 20th, 2009 @ 12:02 PM
- State changed from new to unconfirmed
@Paul: What version of DataMapper are you using? I remember committing a fix for the dm-core RC1 a few weeks ago in edge.
-
Paul Meserve July 20th, 2009 @ 12:22 PM
I installed dm-core just today after adding gems.datamapper.org, and this was code that was working in 0.9.11
After requiring dm-core:
DataMapper::VERSION # => "0.10.0"
-
Dan Kubb (dkubb) July 20th, 2009 @ 01:44 PM
@Paul: Right. When I said it's fixed in edge, I meant that I fixed it after the RC1 release on gems.datamapper.org and you could get it by installing from git.
There will be an RC2 once I have a few days to review and package everything up. (this week hopefully)
-
Paul Meserve July 20th, 2009 @ 02:40 PM
Ahh sorry, had seen a somewhat similar ticket from a month ago and I assumed that was what you meant. Reinstalled the dm-core gem from github next branch and the problem is fixed. Thanks for the help
-
Dan Kubb (dkubb) July 20th, 2009 @ 06:18 PM
- State changed from unconfirmed to resolved
- Assigned user set to Dan Kubb (dkubb)
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »