Parent

Files

RailsBestPractices::Checks::UseScopeAccessCheck

Check a controller to make sure using scope access

Implementation: simply check if or unless compare with current_user or current_user.id and there is a redirect_to message in if or unless block

Public Instance Methods

evaluate_start(node) click to toggle source
# File lib/rails_best_practices/checks/use_scope_access_check.rb, line 18
def evaluate_start(node)
  add_error "use scope access" if current_user_redirect?(node)
end
interesting_files() click to toggle source
# File lib/rails_best_practices/checks/use_scope_access_check.rb, line 14
def interesting_files
  CONTROLLER_FILES
end
interesting_nodes() click to toggle source
# File lib/rails_best_practices/checks/use_scope_access_check.rb, line 10
def interesting_nodes
  [:if, :unless]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.