class RailsBestPractices::Reviews::MoveModelLogicIntoModelReview
Review
a controller file to make sure that complex model logic should not exist in controller, should be moved into a model.
See the best practice details here rails-bestpractices.com/posts/2010/07/21/move-model-logic-into-the-model/
Implementation:
Review
process:
check all method defines in the controller files, if there are multiple method calls apply to one receiver, and the receiver is a variable, then they are complex model logic, and they should be moved into model.
Public Class Methods
new(options = {})
click to toggle source
Calls superclass method
# File lib/rails_best_practices/reviews/move_model_logic_into_model_review.rb, line 21 def initialize(options = {}) super(options) @use_count = options['use_count'] || 4 end