Hi Simon That works and this is what I started from, but I was trying to follow this document http://sequel.rubyforge.org/rdoc/files/doc/querying_rdoc.html where it says: Symbols
If you have a boolean column in the database, and you want only true values, you can just provide the column symbol to filter: Artist.where(:retired) # SELECT * FROM artists WHERE retired Which is exactly what I want but it did not work. Ollie On Thursday, 12 April 2012 09:45:00 UTC+1, Simon Arnaud wrote: > > > When I do Service.where(:hb_eligible).sql in irb it returns > > => "SELECT * FROM `services` WHERE `hb_eligible`" > > which in my limited understanding of SQL is what I want. > > It seems you expect the SQL "WHERE" clause to behave like Ruby "if", > and it does not. > > Try: > Service.where(:hb_eligible => true) > > Simon > > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/HvOGXfK71DUJ. 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/sequel-talk?hl=en.
