I'm working on payment system with Stripe. I have to search customer after receiving stripe webhook. But this error below occurs.
ActiveRecord::StatementInvalid (SQLite3::SQLException: near "'cus_xxxxx'": syntax error: SELECT "users".* FROM "users" WHERE (stripe_customer_id 'cus_xxxxx') ORDER BY "users"."id" ASC LIMIT ?):
Customer which has cus_xxxxx exists. But I have to remove single quotation from this...
@user = User.where('stripe_customer_id ?', "#{source['customer'].gsub("'", "")}").first
I have tried like this. But that wouldn't work.