class RuboCop::Cop::Rails::SaveBang
def check_assignment(assignment)
def check_assignment(assignment) node = right_assignment_node(assignment) return unless node return unless CREATE_PERSIST_METHODS.include?(node.method_name) return unless expected_signature?(node) return if persisted_referenced?(assignment) add_offense(node, :selector, format(CREATE_MSG, "#{node.method_name}!", node.method_name.to_s, node.method_name.to_s)) end