diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-02 07:27:22 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-02 07:27:22 -0700 |
commit | 3a923e034bd8273c5b852a98cd18c79a13425db7 (patch) | |
tree | 0be0916a199b89aabc2d66d5d7b1e5fb3226dbf9 /activerecord/test/models/company.rb | |
parent | 173d4b9d93bac1e0b60520e3850f2b09e6a44a7f (diff) | |
parent | 4bf1ecd6d8ce38e63a0be81287b07f402ce8b5c8 (diff) | |
download | rails-3a923e034bd8273c5b852a98cd18c79a13425db7.tar.gz rails-3a923e034bd8273c5b852a98cd18c79a13425db7.tar.bz2 rails-3a923e034bd8273c5b852a98cd18c79a13425db7.zip |
Merge pull request #11241 from neerajdotname/deprecated-counter-sql
Removed support for deprecated `counter_sql`
Diffstat (limited to 'activerecord/test/models/company.rb')
-rw-r--r-- | activerecord/test/models/company.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb index b988184f34..12fb183bb3 100644 --- a/activerecord/test/models/company.rb +++ b/activerecord/test/models/company.rb @@ -35,13 +35,7 @@ module Namespaced end class Firm < Company - ActiveSupport::Deprecation.silence do - has_many :clients, -> { order "id" }, :dependent => :destroy, :counter_sql => - "SELECT COUNT(*) FROM companies WHERE firm_id = 1 " + - "AND (#{QUOTED_TYPE} = 'Client' OR #{QUOTED_TYPE} = 'SpecialClient' OR #{QUOTED_TYPE} = 'VerySpecialClient' )", - :before_remove => :log_before_remove, - :after_remove => :log_after_remove - end + has_many :clients, -> { order "id" }, :dependent => :destroy, :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, -> { order "id DESC" }, :class_name => "Client" @@ -56,15 +50,6 @@ class Firm < Company has_many :clients_like_ms_with_hash_conditions, -> { where(:name => 'Microsoft').order("id") }, :class_name => "Client" ActiveSupport::Deprecation.silence do has_many :clients_using_sql, :class_name => "Client", :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" } - has_many :clients_using_counter_sql, :class_name => "Client", - :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id} " }, - :counter_sql => proc { "SELECT COUNT(*) FROM companies WHERE client_of = #{id}" } - has_many :clients_using_zero_counter_sql, :class_name => "Client", - :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" }, - :counter_sql => proc { "SELECT 0 FROM companies WHERE client_of = #{id}" } - has_many :no_clients_using_counter_sql, :class_name => "Client", - :finder_sql => 'SELECT * FROM companies WHERE client_of = 1000', - :counter_sql => 'SELECT COUNT(*) FROM companies WHERE client_of = 1000' has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1' end has_many :plain_clients, :class_name => 'Client' |