Parent

Files

RailsBestPractices::Checks::MoveFinderToNamedScopeCheck

Check a controller file to make sure finder is simple.

Complex finder in controller is a code smell, use namd_scope instead.

Implementation: check method :find, :all, :first, :last with hash parameters.

Constants

FINDER

Public Instance Methods

evaluate_start(node) click to toggle source
# File lib/rails_best_practices/checks/move_finder_to_named_scope_check.rb, line 22
def evaluate_start(node)
  add_error "move finder to named_scope" if finder?(node)
end
interesting_files() click to toggle source
# File lib/rails_best_practices/checks/move_finder_to_named_scope_check.rb, line 18
def interesting_files
  CONTROLLER_FILES
end
interesting_nodes() click to toggle source
# File lib/rails_best_practices/checks/move_finder_to_named_scope_check.rb, line 14
def interesting_nodes
  [:call]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.