Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move add_counter_cache_methods to class level

  • Loading branch information...
commit cae842e662bbf6d6e6c87857d6ab68a982b1663f 1 parent bfa8249
@rafaelfranca rafaelfranca authored
View
4 activerecord/lib/active_record/associations/builder/belongs_to.rb
@@ -20,12 +20,12 @@ def self.define_callbacks(model, reflection)
def define_accessors(mixin, reflection)
super
- add_counter_cache_methods mixin
+ self.class.add_counter_cache_methods mixin
end
private
- def add_counter_cache_methods(mixin)
+ def self.add_counter_cache_methods(mixin)
return if mixin.method_defined? :belongs_to_counter_cache_after_create
mixin.class_eval do
Please sign in to comment.
Something went wrong with that request. Please try again.