On 03 Oct 2009, at 14:39, adedip wrote:

> morover..
> when I use Article.scope(:all, ....
> it still behave like an array..
> Instead using Article.scoped_by it seems to work better.. but I guess
> I can't do something like this:
>
> proxy = Article.scoped_by_author_and_date(aut,"YEAR(date) BETWEEN ?
> AND ?",tf.year,tt,year)
>  @articles = proxy.find_by_solr(params[:query]).results
>
> in the server log I get this:
>  Article Load (1.2ms)   SELECT * FROM `articles` WHERE (articles.id
> in (1)) AND (`articles`.`date` = 'date BETWEEN ? AND ?' AND
> `articles`.`author` = 'No Author')
>
> the question marks comes out :S

You didn't put the conditions part into square brackets, that could be  
the reason.


Best regards

Peter De Berdt


--~--~---------~--~----~------------~-------~--~----~
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