From e6cc2ea201857a5f3700f589336df2880564cfea Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 4 Nov 2011 11:16:55 +0000 Subject: Allow the :class_name option for associations to take a symbol. This is to avoid confusing newbies, and to be consistent with the fact that other options like :foreign_key already allow a symbol or a string. --- activerecord/test/models/company.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models/company.rb') diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index c1f7a4171a..78eb4c57ac 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -42,6 +42,7 @@ class Firm < Company :before_remove => :log_before_remove, :after_remove => :log_after_remove has_many :unsorted_clients, :class_name => "Client" + has_many :unsorted_clients_with_symbol, :class_name => :Client has_many :clients_sorted_desc, :class_name => "Client", :order => "id DESC" has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id" has_many :unvalidated_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :validate => false -- cgit v1.2.3 From 7af719e81c46d06f50cd9b3caff38b945c5f2d84 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Tue, 29 Nov 2011 16:33:50 +0000 Subject: Deprecate set_sequence_name in favour of self.sequence_name= --- activerecord/test/models/company.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/models/company.rb') diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index 78eb4c57ac..fe9c465c81 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -4,7 +4,7 @@ end class Company < AbstractCompany attr_protected :rating - set_sequence_name :companies_nonstd_seq + self.sequence_name = :companies_nonstd_seq validates_presence_of :name -- cgit v1.2.3