diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-05 14:59:23 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-05 14:59:23 -0300 |
commit | 2797de25141098c501dd32d72af8050997cfe036 (patch) | |
tree | 7632522e3374b1052956df159c0d6886c31c10e5 /activerecord/lib | |
parent | aed11fdc7c07e42fbaefb5110f5ee5eab2db5a3e (diff) | |
parent | d79e99a0758bd63e3747ee8586d3630036e16831 (diff) | |
download | rails-2797de25141098c501dd32d72af8050997cfe036.tar.gz rails-2797de25141098c501dd32d72af8050997cfe036.tar.bz2 rails-2797de25141098c501dd32d72af8050997cfe036.zip |
Merge pull request #25668 from kamipo/use_squish_rather_than_strip_heredoc
Use `squish` rather than `strip_heredoc`
Diffstat (limited to 'activerecord/lib')
-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 |