Module: Merit::ControllerExtensions

Defined in:
lib/merit/controller_extensions.rb

Overview

Sets up an app-wide after_filter, and inserts merit_action entries if there are defined rules (for badges or points) for current 'controller_path#action_name'

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/merit/controller_extensions.rb', line 6

def self.included(base)
  base.after_filter do |controller|
    if rules_defined?
      log_merit_action
      Merit::Action.check_unprocessed if Merit.checks_on_each_request
    end
  end
end