Check a model creation to make sure using model association.
Implementation:
check :attrasgn, if xxx_id is assigned to a variable, set the value of the assigned variable to true.
check :call, if call message :save and caller is included in variables, add error.
# File lib/rails_best_practices/checks/use_model_association_check.rb, line 16 def evaluate_start(node) @variables = {} node.recursive_children do |child| case child.node_type when :attrasgn attribute_assignment(child) when :call call_assignment(child) else end end @variables = nil end
Generated with the Darkfish Rdoc Generator 2.