how to convert legacy query to ActiveRecord Rails way
- by josh
I have a query in my code as below
@sqladdpayment = "INSERT INTO payments (orderid, ttlprodcost, paytype,
paystatus,created_at,updated_at,userid,storeid)
VALUES ('" + session[:ordersid] + "', '" + session[:totalcost] + "', '"
+ "1"+ "', '" + "complete" +"',current_date, current_date, '"+"1"+"','"+ "1"+"')"
Here the table payments and…