Skip to content

Commit

Permalink
Pluralize model name for counter cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchi committed Sep 5, 2014
1 parent 60ccb55 commit ced05ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid/magic_counter_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def counter_cache(*args, &block)
private

def get_counter_name(options)
options.fetch(:field, "#{actual_model_name.demodulize.underscore}_count").to_s
options.fetch(:field, "#{actual_model_name.demodulize.underscore.pluralize}_count").to_s
end

def condition_result(condition, doc)
Expand Down

0 comments on commit ced05ee

Please sign in to comment.