I have a News
Model which has polymorphic association with ContentRoles
I want to query news on created_at such that it fetches all the news greater than given timestamp
my query currently looks something like this
@news = News.includes(:content_roles).where("created_at >= ?",params[:created_at] ,content_roles: {role_id: @role,content_type: "news"})
which is incorrect as it expects only one parameter for the prepared statement.
how do I query on news created_at with conditions ?