hello,

Im interfacing a PHP app with my rails app and one of the tables im
trying to do a find on has an enum column. So when i run the find, its
adding an extra condition. This is my first time interfacing with a DB
like this so im not quite sure how to remedy my problem

This is my named_scope
named_scope :ads, lambda { |advertiser| { :conditions =>
["advertiser_id = ? && type = ?", advertiser, "advertisement"]}

this is what i get in the terminal

SELECT * FROM `broadcast` WHERE (advertiser_id = '5' && type =
'advertisement') AND ( (`broadcast`.`type` = 'Broadcast' ) )

so its appending the (`broadcast`.`type` = 'Broadcast' ). There is a
type column in the DB that is an enum column.

any help?
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to