Sha256: 497b5e165e1b2c17cc2d95dea4438a97866cbb07df92c1f7fab11eb9e8214eac

Contents?: true

Size: 1.03 KB

Versions: 35

Compression:

Stored size: 1.03 KB

Contents

# Be sure to restart your server when you modify this file.
#
# 5 stars is a common ranking use case. They are not given at specified
# actions like badges, you should define a cron job to test if ranks are to be
# granted.
#
# +set_rank+ accepts:
# * :+level+ ranking level (greater is better)
# * :+to+ model or scope to check if new rankings apply
# * :+level_name+ attribute name (default is empty and results in 'level'
#   attribute, if set it's appended like 'level_#{level_name}')

module Merit
  class RankRules
    include Merit::RankRulesMethods

    def initialize
      # set_rank :level => 1, :to => Commiter.active do |commiter|
      #   commiter.repositories.count > 1 && commiter.followers >= 10
      # end
      #
      # set_rank :level => 2, :to => Commiter.active do |commiter|
      #   commiter.branches.count > 1 && commiter.followers >= 10
      # end
      #
      # set_rank :level => 3, :to => Commiter.active do |commiter|
      #   commiter.branches.count > 2 && commiter.followers >= 20
      # end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
merit-4.0.3 lib/merit/generators/templates/merit_rank_rules.erb
merit-4.0.2 lib/merit/generators/templates/merit_rank_rules.erb
merit-4.0.1 lib/merit/generators/templates/merit_rank_rules.erb
merit-4.0.0 lib/merit/generators/templates/merit_rank_rules.erb
merit-3.0.3 lib/generators/merit/templates/merit_rank_rules.rb
merit-3.0.2 lib/generators/merit/templates/merit_rank_rules.rb
merit-3.0.1 lib/generators/merit/templates/merit_rank_rules.rb
merit-3.0.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.4.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.3.4 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.3.3 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.3.2 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.3.1 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.3.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.2.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.1.2 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.1.1 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.1.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-2.0.0 lib/generators/merit/templates/merit_rank_rules.rb
merit-1.9.0 lib/generators/merit/templates/merit_rank_rules.rb