Class ActionFlow::NewFlowValidations
In: lib/plugins/new_flow_validations.rb
Parent: ActionFlow::Plugin

This class adds a couple validations before creating a new flow.

Methods

notify  

Public Class methods

Method to override in a plugin subclass. This method will be called when a controller encounters one of it‘s internal events

[Source]

# File lib/plugins/new_flow_validations.rb, line 37
    def self::notify( internal_event_name, controller, flow_data)
          
      # Make sure there's a start_step defined

      raise (ActionFlowError.new, "Your controller must declare a start step name. Use 'start_step :step_name' and define this step in the mapping.") if controller.instance_variable_get("@_start_step").nil?
              
      # Make sure there's an end_step defined

      raise (ActionFlowError.new, "Your controller must declare an end step name. Use 'end_step :step_name' and define this step in the mapping. I suggest using a view step which could redirect if you don't want to create a 'thank you' screen.") if controller.instance_variable_get("@_end_step").nil?
          
    end

[Validate]