Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use squish rather than strip_heredoc #25668

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/persistence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ def reload(options = nil)
#
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
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/touch_later.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module TouchLater

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
Expand Down