Sha256: faca0e4ce9ae975e8b23f0ec2938324a93e2733b9900865141591c2c615a6fb4

Contents?: true

Size: 746 Bytes

Versions: 3

Compression:

Stored size: 746 Bytes

Contents

# Points are a simple integer value which are given to "meritable" resources
# according to rules in +app/models/merit/point_rules.rb+. They are given on
# actions-triggered, either to the action user or to the method (or array of
# methods) defined in the +:to+ option.
#
# 'score' method may accept a block which evaluates to boolean
# (recieves the object as parameter)

module Merit
  class PointRules
    include Merit::PointRulesMethods

    def initialize
      # score 10, :on => 'users#update' do
      #   user.name.present?
      # end
      #
      # score 15, :on => 'reviews#create', :to => [:reviewer, :reviewed]
      #
      # score 20, :on => [
      #   'comments#create',
      #   'photos#create'
      # ]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
merit-1.1.1 lib/generators/merit/templates/merit_point_rules.rb
merit-1.1.0 lib/generators/merit/templates/merit_point_rules.rb
merit-1.0.1 lib/generators/merit/templates/merit_point_rules.rb