On Sep 25, 9:40 am, Thorsten Müller <[EMAIL PROTECTED]> wrote:
>
> @upcoming_events = Event.find(:all, :conditions => ["venue_id IN (?)
> AND date > '?' ", @nearby_venues.join(","), Time.now.to_s(:db) ],
> order => date)

A minor tidyup: the above is equivalent to

@upcoming_events = Event.find(:all, :conditions => ["venue_id IN (?)
AND date > ? ", @nearby_venues, Time.now ], order => 'date')

Active Record takes care of the boring stuff like creating the comma
separated list of ids and so on.

Fred

>
> so using a kind of SQL string, the variable part replaced by question
> marks
> and the values to be filled in for the ? directly following the string
--~--~---------~--~----~------------~-------~--~----~
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