From 8312a0d22212798864f142b5a94805e0baa6c562 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Tue, 3 Jan 2017 10:12:47 -0500 Subject: 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. --- activerecord/test/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/user.rb b/activerecord/test/models/user.rb index 47649e0a77..c099c57e37 100644 --- a/activerecord/test/models/user.rb +++ b/activerecord/test/models/user.rb @@ -5,7 +5,7 @@ class User < ActiveRecord::Base has_secure_token :auth_token has_and_belongs_to_many :jobs_pool, - class_name: Job, + class_name: "Job", join_table: "jobs_pool" end -- cgit v1.2.3