Is it possible to specify parameters for: union in the same way: conditions?
here is an example (sql code doesn't matter)
named_scope :threads, { :joins => [" LEFT JOIN groups_messages gm ON messages.id=gm.message_id AND gm.group_id IN (?) ",@group_ids_array], :conditions => ["creator_id=? AND messages.id IN (?)", current_user_id, @message_ids_array] }
in this example, the parameters for: conditions will be inserted correctly, but for: joins I will get an error
Association named ' LEFT JOIN groups_messages gm ON messages.id=gm.message_id and gm.group_id IN (?) ' was not found; perhaps you misspelled it?
Which function replaces the parameters for: conditions?
join ruby-on-rails substitution
Pavel K.
source share