diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-08-23 16:07:48 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-10-23 12:50:45 -0400 |
commit | e65aff70696be52b46ebe57207ebd8bb2cfcdbb6 (patch) | |
tree | 23fb9ade8406093b113ca19b00134733f196021d /activerecord/lib/active_record | |
parent | 8f5b34df81175e30f68879479243fbce966122d7 (diff) | |
download | rails-e65aff70696be52b46ebe57207ebd8bb2cfcdbb6.tar.gz rails-e65aff70696be52b46ebe57207ebd8bb2cfcdbb6.tar.bz2 rails-e65aff70696be52b46ebe57207ebd8bb2cfcdbb6.zip |
Remove deprecated support to passing a class to `:class_name` on associations
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 2723b3dc03..d1c2286227 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1848,7 +1848,7 @@ module ActiveRecord builder = Builder::HasAndBelongsToMany.new name, self, options - join_model = ActiveSupport::Deprecation.silence { builder.through_model } + join_model = builder.through_model const_set join_model.name, join_model private_constant join_model.name @@ -1877,7 +1877,7 @@ module ActiveRecord hm_options[k] = options[k] if options.key? k end - ActiveSupport::Deprecation.silence { has_many name, scope, hm_options, &extension } + 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 97adfb4352..a60dad91d6 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -431,14 +431,7 @@ module ActiveRecord @association_scope_cache = Concurrent::Map.new if options[:class_name] && options[:class_name].class == Class - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Passing a class to the `class_name` is deprecated and will raise - an ArgumentError in Rails 5.2. It eagerloads more classes than - necessary and potentially creates circular dependencies. - - Please pass the class name as a string: - `#{macro} :#{name}, class_name: '#{options[:class_name]}'` - MSG + raise ArgumentError, "A class was passed to `:class_name` but we are expecting a string." end end |