aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/errors.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-02-16 19:28:30 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-02-16 19:28:30 -0500
commit89bcca59e91fa9da941de890012872e8288e77b0 (patch)
tree8d2d4015acc7c4630d1d84b47e0ddd67a193ebb3 /activerecord/lib/active_record/errors.rb
parent2c89d1dda4077b2a99ddcced59bdd7a9a21b39a0 (diff)
downloadrails-89bcca59e91fa9da941de890012872e8288e77b0.tar.gz
rails-89bcca59e91fa9da941de890012872e8288e77b0.tar.bz2
rails-89bcca59e91fa9da941de890012872e8288e77b0.zip
Remove usage of strip_heredoc in the framework in favor of <<~
Some places we can't remove because Ruby still don't have a method equivalent to strip_heredoc to be called in an already existent string.
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r--activerecord/lib/active_record/errors.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index efcbd44776..e4bc6e0d8b 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -120,13 +120,13 @@ module ActiveRecord
def initialize(adapter = nil, message: nil, table: nil, foreign_key: nil, target_table: nil, primary_key: nil)
@adapter = adapter
if table
- msg = <<-EOM.strip_heredoc
+ msg = <<~EOM
Column `#{foreign_key}` on table `#{table}` has a type of `#{column_type(table, foreign_key)}`.
This does not match column `#{primary_key}` on `#{target_table}`, which has type `#{column_type(target_table, primary_key)}`.
To resolve this issue, change the type of the `#{foreign_key}` column on `#{table}` to be :integer. (For example `t.integer #{foreign_key}`).
EOM
else
- msg = <<-EOM
+ msg = <<~EOM
There is a mismatch between the foreign key and primary key column types.
Verify that the foreign key column type and the primary key of the associated table match types.
EOM