class RailsBestPractices::Reviews::MoveCodeIntoControllerReview
Review
a view file to make sure there is no finder, finder should be moved to controller.
See the best practice details here rails-bestpractices.com/posts/2010/07/24/move-code-into-controller/
Implementation:
Review
process:
only check all view files to see if there are finders, then the finders should be moved to controller.
Constants
- FINDERS
Private Instance Methods
finder?(node)
click to toggle source
check if the node is a finder call node.
# File lib/rails_best_practices/reviews/move_code_into_controller_review.rb, line 41 def finder?(node) node.receiver.const? && FINDERS.include?(node.message.to_s) end