How do I match a record on one value of the Flag please...?
class Foo
property :applies_to Flag[:a, :b, :c]
end
Foo.create(:applies_to => [:a, :c])
Foo.first(:applies_to => :a) # => nil
SELECT * FROM foos WHERE applies_to = 1 ...
but of course applies_to is 5 (1 + 4)...
What am I missing, please? Do I have to do Foo.all.select{|f|
f.applies_to & [:a] } ?
Many thanks,
Jerry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---