Module: Boilerman::Checks

Defined in:
lib/boilerman/checks.rb

Class Method Summary collapse

Class Method Details

.csrf_checkObject



17
18
19
20
21
# File 'lib/boilerman/checks.rb', line 17

def self.csrf_check
  Boilerman::Actions.get_action_hash.select do |controller, actions|
    #TODO implement verify_authenticity_token filter checking logic
  end
end

.inheritance_check(inheritance_controller = "ApplicationController") ⇒ Object

Return controllers that don’t have inheritance_controller in it’s ancestor list. This method defaults to checking for ApplicationController.



6
7
8
9
10
11
12
13
14
15
# File 'lib/boilerman/checks.rb', line 6

def self.inheritance_check(inheritance_controller="ApplicationController")
  inheritance_controller = inheritance_controller.constantize

  # On top of rejecting controllers which do not have the passed in
  # inheritance_controller, we also want to reject ActionController::Base
  # as this won't be a useful result (at least I don't think it will be)
  Boilerman.controllers.reject do |controller|
    controller.ancestors.include?(inheritance_controller) || controller == ActionController::Base
  end
end