diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-03 23:19:29 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 11:58:43 -0300 |
commit | 87c8ce340c6c83342df988df247e9035393ed7a0 (patch) | |
tree | 76cc493c2199395ba965b0f4a3e9cd64a2c3fe98 /activerecord/lib | |
parent | 37175a24bd508e2983247ec5d011d57df836c743 (diff) | |
download | rails-87c8ce340c6c83342df988df247e9035393ed7a0.tar.gz rails-87c8ce340c6c83342df988df247e9035393ed7a0.tar.bz2 rails-87c8ce340c6c83342df988df247e9035393ed7a0.zip |
Remove deprecated automatic counter caches on `has_many :through`
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 7a050ca224..0dbd32ae83 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -49,16 +49,7 @@ module ActiveRecord end save_through_record(record) - if has_cached_counter? && !through_reflection_updates_counter_cache? - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Automatic updating of counter caches on through associations has been - deprecated, and will be removed in Rails 5. Instead, please set the - appropriate `counter_cache` options on the `has_many` and `belongs_to` - for your associations to #{through_reflection.name}. - MSG - update_counter_in_database(1) - end record end @@ -211,11 +202,6 @@ module ActiveRecord def invertible_for?(record) false end - - def through_reflection_updates_counter_cache? - counter_name = cached_counter_attribute_name - inverse_updates_counter_named?(counter_name, through_reflection) - end end end end |