How to include NOT in Rails query before Rails 4 when it is tied with other parameters? -
i'm trying combine existing rails query not query. read rails 4 supports well, i'd know how in rails 3.
@next_question = answer.where(:topic => subject, :result => session.question_pool, :user_id => current_user.id, 'practicesession_id != ?', params[:session_id]).first
i've tried above , keep getting error. portion relates not last bit of query (practicesession_id). advice on how this?
in rails 3 work
@next_question = answer.where(:topic => subject, :result => session.question_pool, :user_id => current_user.id) .where(answer.arel_table[:practicesession_id].not_eq(params[:session_id])).first
Comments
Post a Comment