aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-01-09 17:32:45 -0500
committerGitHub <noreply@github.com>2017-01-09 17:32:45 -0500
commit6be3945d50f00e8a3286c8c794a8230a4c556a24 (patch)
tree20ced24f412c44a59646284d1b4d66007570bacc /activerecord
parent8cb3cdffdb70f3575518d24ea96ec891e40d21d0 (diff)
parent4cfa60558a1d9cecc7bfb90fd8d767b5572ca404 (diff)
downloadrails-6be3945d50f00e8a3286c8c794a8230a4c556a24.tar.gz
rails-6be3945d50f00e8a3286c8c794a8230a4c556a24.tar.bz2
rails-6be3945d50f00e8a3286c8c794a8230a4c556a24.zip
Merge pull request #27622 from kamipo/improve_deprecation_message
Improve deprecation message for deprecated reflection class name
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations.rb4
-rw-r--r--activerecord/lib/active_record/reflection.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index f3e2189bcb..4606c91ffd 100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1827,7 +1827,7 @@ module ActiveRecord
builder = Builder::HasAndBelongsToMany.new name, self, options
- join_model = builder.through_model
+ join_model = ActiveSupport::Deprecation.silence { builder.through_model }
const_set join_model.name, join_model
private_constant join_model.name
@@ -1856,7 +1856,7 @@ module ActiveRecord
hm_options[k] = options[k] if options.key? k
end
- has_many name, scope, hm_options, &extension
+ ActiveSupport::Deprecation.silence { has_many name, scope, hm_options, &extension }
_reflections[name.to_s].parent_reflection = habtm_reflection
end
end
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 2da85df9e9..8af0d06ecb 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -372,7 +372,7 @@ module ActiveRecord
necessary and potentially creates circular dependencies.
Please pass the class name as a string:
- `belongs_to :client, class_name: 'Company'`
+ `#{macro} :#{name}, class_name: '#{options[:class_name]}'`
MSG
end
end