dkubb changed the topic of #datamapper to: Datamapper v1.2.0 | Mailing List: http://is.gd/aa9D | Logs: http://is.gd/qWAL7V | DataMapper 2 Renamed to ROM, see #rom-rb for development
brianpWins has quit [Quit: brianpWins]
kapowaz has quit [Ping timeout: 246 seconds]
grandy has quit [Ping timeout: 256 seconds]
zombor has joined #datamapper
noca has quit [Ping timeout: 246 seconds]
jpr5 has joined #datamapper
zombor has quit [Remote host closed the connection]
snusnu has quit [Quit: Leaving.]
skade has quit [Quit: Computer has gone to sleep.]
zombor has joined #datamapper
zombor has quit [Ping timeout: 256 seconds]
rsim has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
grandy has joined #datamapper
zombor has joined #datamapper
kapowaz has joined #datamapper
kapowaz has quit [Ping timeout: 248 seconds]
grandy has quit [Ping timeout: 264 seconds]
zombor has quit [Remote host closed the connection]
brianpWins has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
grandy has joined #datamapper
kapowaz has joined #datamapper
mbj has joined #datamapper
skade has joined #datamapper
vockav has joined #datamapper
<vockav>
I have a flag property in my table. I would like to fetch records based on the flag value. I searched the internet, but found no solution.
<onewheelskyward>
Model.all(flag: true)?
rsim has joined #datamapper
<vockav>
flag is not a boolean value. The property name is colors, and it can have values [:blue, :green, :yellow, :red]. It can have one or more than one value.
<vockav>
Now, i want to search records that have either :blue or :red, or both
<onewheelskyward>
Punch the query output to max with DataMapper::Logger.new($stdout, :debug)
<onewheelskyward>
Oh, a flag type, I see what you're saying now.
<vockav>
yes
<onewheelskyward>
So what if you do Model,all(colours: [:red, :blue]), what's the resulting sql?
mbj has quit [Ping timeout: 240 seconds]
<onewheelskyward>
I'm guessing it's doing bit shifting in a data field.
<vockav>
it works only if a record has one color. For e.g., Model.all(colours => [:red]) returns all records having color as red. But not the records that have red and blue
<onewheelskyward>
interesting.
<onewheelskyward>
What does the sql look like for that?
<vockav>
Also, Model.all(colours: [:red, :blue]) does not return records having color as red and blue
<vockav>
Do you want me to paste the query here, or else where?