I am creating a Sinatra application using three database tables: user , post and like .
I want to run a query that finds an entry in a like table, for example:
FIND in like WHERE user_id == params[:user_id] AND post_id == params[:post_id]
(for one condition I will use: Like.find_by_user_id(params[:user_id]) )
My question is:
How to run a search query with multiple conditions using ActiveRecord Gem?
ruby ruby-on-rails activerecord gem sinatra-activerecord
Lior elrom
source share