Tyl Tan wrote: > Hi, i was just wondering if its is possible to put a if statment > inside the find conditions > > > for example: > > grovery_price = model.find(:first, :conditions => [ "if x = ? then y > must = ?", 200, 300] > > I have been googling for some time for a solution to this but i just > can't seem to find any.
Does :conditions => ["(x = ? and y = ?) or x <> ?", 200, 300, 200] work? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---