Buenas!
Estoy utilizando la gem 'searchlogic' para unas búsquedas y no puedo
usar la condición OR en por ejemplo lo siguiente:
person = Person.search(:birth_date_lte => Time.now.srftime('%Y-%m-%d),
:birth_date_null => null)
El SQL que genera por detrás es:
SELECT person.* FROM person WHERE (birth_date IS NULL) AND (birth_date
<= '2011-08-16')
pero necesito que sea un OR! La solución sería lo siguiente (pero no
funciona..)
person = Person.search(:birth_date_null_or_lte =>
Time.now.srftime('%Y-%m-%d))
Alguna idea? Gracias!
on 2011-08-16 20:25
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.