Skip to content

Commit

Permalink
Merge pull request #151 from hsbt/fix-ruby-2.2
Browse files Browse the repository at this point in the history
Applied keyword argument fixes on Ruby 2.2.0
  • Loading branch information
flyerhzm committed Apr 8, 2014
2 parents a158013 + 3f42ed9 commit 738eff9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bullet/active_record3x.rb
Expand Up @@ -93,7 +93,7 @@ def set_inverse_instance(record)
::ActiveRecord::Associations::HasManyAssociation.class_eval do
alias_method :origin_has_cached_counter?, :has_cached_counter?

def has_cached_counter?(reflection = reflection)
def has_cached_counter?(reflection = reflection())
result = origin_has_cached_counter?(reflection)
Bullet::Detector::CounterCache.add_counter_cache(owner, reflection.name) unless result
result
Expand Down
2 changes: 1 addition & 1 deletion lib/bullet/active_record4.rb
Expand Up @@ -93,7 +93,7 @@ def set_inverse_instance(record)
::ActiveRecord::Associations::HasManyAssociation.class_eval do
alias_method :origin_has_cached_counter?, :has_cached_counter?

def has_cached_counter?(reflection = reflection)
def has_cached_counter?(reflection = reflection())
result = origin_has_cached_counter?(reflection)
Bullet::Detector::CounterCache.add_counter_cache(owner, reflection.name) unless result
result
Expand Down
2 changes: 1 addition & 1 deletion lib/bullet/active_record41.rb
Expand Up @@ -86,7 +86,7 @@ def reader(force_reload = false)
::ActiveRecord::Associations::HasManyAssociation.class_eval do
alias_method :origin_has_cached_counter?, :has_cached_counter?

def has_cached_counter?(reflection = reflection)
def has_cached_counter?(reflection = reflection())
result = origin_has_cached_counter?(reflection)
Bullet::Detector::CounterCache.add_counter_cache(owner, reflection.name) unless result
result
Expand Down

0 comments on commit 738eff9

Please sign in to comment.