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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -