diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-04-21 13:59:25 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-04-21 14:00:38 +0900 |
commit | ac1efe7a947ba04b276a7109f1a86e559a6ab683 (patch) | |
tree | f8735f0cca24e1323b8933b2288c7c393d1e077f /activerecord | |
parent | eb2f2fc2fc091f9c056206c8955aa69a642855ea (diff) | |
download | rails-ac1efe7a947ba04b276a7109f1a86e559a6ab683.tar.gz rails-ac1efe7a947ba04b276a7109f1a86e559a6ab683.tar.bz2 rails-ac1efe7a947ba04b276a7109f1a86e559a6ab683.zip |
Fix typo in the `touch_all` doc [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c29f7e7115..c055b97061 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -378,19 +378,19 @@ module ActiveRecord # === Examples # # # Touch all records - # Person.all.touch + # Person.all.touch_all # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670'" # # # Touch multiple records with a custom attribute - # Person.all.touch(:created_at) + # Person.all.touch_all(:created_at) # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670', \"created_at\" = '2018-01-04 22:55:23.132670'" # # # Touch multiple records with a specified time - # Person.all.touch(time: Time.new(2020, 5, 16, 0, 0, 0)) + # Person.all.touch_all(time: Time.new(2020, 5, 16, 0, 0, 0)) # # => "UPDATE \"people\" SET \"updated_at\" = '2020-05-16 00:00:00'" # # # Touch records with scope - # Person.where(name: 'David').touch + # Person.where(name: 'David').touch_all # # => "UPDATE \"people\" SET \"updated_at\" = '2018-01-04 22:55:23.132670' WHERE \"people\".\"name\" = 'David'" def touch_all(*names, time: nil) attributes = Array(names) + klass.timestamp_attributes_for_update_in_model |