1 2 3
# But in SQL fragments, especially in conditions fragments (:conditions => "..."), the connection.execute() # or Model.find_by_sql() methods, it has to be applied manually. Instead of passing a string to the conditions ...
Ruby On ActiveRecord find_by_sql
by David,
January 18, 2010 21:24
1 2 3
Clip.find_by_sql(["select * from clips where not exists (select 'clip_id' from histories where histories.clip_id = clips.id and histories.user_id = ?) ORDER BY clips.created_at DESC LIMIT 20", user.id])
Ruby ActiveRecord find_by_sql
How can I turn this into so...
I thought that the ["?", va...