Skip to content

Instantly share code, notes, and snippets.

@MittalPatel-BTC
Created May 6, 2019 10:59
Show Gist options
  • Save MittalPatel-BTC/a956004023c73287154820bdf5352657 to your computer and use it in GitHub Desktop.
Save MittalPatel-BTC/a956004023c73287154820bdf5352657 to your computer and use it in GitHub Desktop.
Rails 6 new method touch_all
# Rails 6
> User.count
SELECT COUNT(*) FROM "users"
=> 3
> User.all.touch_all
UPDATE "users" SET "updated_at" = ? [["updated_at", "2019-04-20 16:10:40.490507"]]
=> 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment