I want rails queries similar to:
UPDATE users SET name="test" WHERE name="test1"
User.update_all({name: 'test'},{name: 'test1'}) # deprecated since Rails 4
or
User.where(name: 'test1').update_all(name: 'test')
User.where("name like 'test1'").update_all("name = 'test'")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With