Ruby on rails 充当标记上的标记计数()方法上的标记

Ruby on rails 充当标记上的标记计数()方法上的标记,ruby-on-rails,ruby,acts-as-taggable-on,Ruby On Rails,Ruby,Acts As Taggable On,我目前在Rails中的acts_as_taggable_on插件中的Model.tag_counts_on()方法方面遇到了一些问题。我找不到关于这个方法的真正文档,我想知道更多关于它接受的参数的信息。我正在尝试获取标签子集上的标签计数,而不是应用程序上的整个标签集,我将如何进行此操作?假设您使用的是mbleigh/作为标记 这是该方法出现在中的gem的名称 我将检查条件和参数 def tag_counts_on(context, options = {}) all_tag_counts(o

我目前在Rails中的acts_as_taggable_on插件中的Model.tag_counts_on()方法方面遇到了一些问题。我找不到关于这个方法的真正文档,我想知道更多关于它接受的参数的信息。我正在尝试获取标签子集上的标签计数,而不是应用程序上的整个标签集,我将如何进行此操作?

假设您使用的是
mbleigh/作为标记

这是该方法出现在中的gem的名称

我将检查条件和参数

def tag_counts_on(context, options = {})
  all_tag_counts(options.merge({:on => context.to_s}))
end

##
# Calculate the tag counts for all tags.
#
# @param [Hash] options Options:
# * :start_at   - Restrict the tags to those created after a certain time
# * :end_at     - Restrict the tags to those created before a certain time
# * :conditions - A piece of SQL conditions to add to the query
# * :limit      - The maximum number of tags to return
# * :order      - A piece of SQL to order by. Eg 'tags.count desc' or 'taggings.created_at desc'
# * :at_least   - Exclude tags with a frequency less than the given value
# * :at_most    - Exclude tags with a frequency greater than the given value
# * :on         - Scope the find to only include a certain context
def all_tag_counts(options = {})..end