Reputation: 832
I tried looking around but could not find an answer on how to implement the combination of AND, |(or). I am getting an error. The code is listed below:
allgames = GameInfo.Get.where(["list = ? AND (lang = ? OR lang = ?)", "yes", "en", @lang]).order(:order)
The error I am getting is below:
The specified query expression syntax is not valid.
please shed some light,
Regards,
Upvotes: 0
Views: 81
Reputation: 13925
Pipe is not used in sql:
where("list = ? AND (lang = ? OR lang = ?)", "yes", 'en',@lang)
Upvotes: 1