diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/touch_later.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index ebdb9efba2..510e8a6e43 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -480,10 +480,10 @@ module ActiveRecord # def touch(*names, time: nil) unless persisted? - raise ActiveRecordError, <<-end_error.strip_heredoc + raise ActiveRecordError, <<-MSG.squish cannot touch on a new or destroyed record object. Consider using persisted?, new_record?, or destroyed? before touching - end_error + MSG end time ||= current_time_from_proper_timezone diff --git a/activerecord/lib/active_record/touch_later.rb b/activerecord/lib/active_record/touch_later.rb index 5c41ab6e39..598873ea3a 100644 --- a/activerecord/lib/active_record/touch_later.rb +++ b/activerecord/lib/active_record/touch_later.rb @@ -9,10 +9,10 @@ module ActiveRecord def touch_later(*names) # :nodoc: unless persisted? - raise ActiveRecordError, <<-end_error.strip_heredoc + raise ActiveRecordError, <<-MSG.squish cannot touch on a new or destroyed record object. Consider using persisted?, new_record?, or destroyed? before touching - end_error + MSG end @_defer_touch_attrs ||= timestamp_attributes_for_update_in_model |