diff options
author | Kir Shatrov <shatrov@me.com> | 2017-01-03 10:12:47 -0500 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-01-09 13:08:33 -0500 |
commit | 8312a0d22212798864f142b5a94805e0baa6c562 (patch) | |
tree | 3ce858cb37e94783c75d6eda171a6dc4d3b2dae6 /activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | |
parent | 80bf3384152a640a36682db875241e2d92db511f (diff) | |
download | rails-8312a0d22212798864f142b5a94805e0baa6c562.tar.gz rails-8312a0d22212798864f142b5a94805e0baa6c562.tar.bz2 rails-8312a0d22212798864f142b5a94805e0baa6c562.zip |
Deprecate reflection class name to accept a class
The idea of `class_name` as an option of reflection is that passing a
string would allow us to lazy autoload the class.
Using `belongs_to :client, class_name: Customer` is eagerloading models more than necessary
and creating possible circular dependencies.
Diffstat (limited to 'activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index 54fb61d6a5..efd2124679 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -86,8 +86,10 @@ class DeveloperWithSymbolClassName < Developer has_and_belongs_to_many :projects, class_name: :ProjectWithSymbolsForKeys end -class DeveloperWithConstantClassName < Developer - has_and_belongs_to_many :projects, class_name: ProjectWithSymbolsForKeys +ActiveSupport::Deprecation.silence do + class DeveloperWithConstantClassName < Developer + has_and_belongs_to_many :projects, class_name: ProjectWithSymbolsForKeys + end end class DeveloperWithExtendOption < Developer |