Module: Forms::Models::Extension

Included in:
FormMail
Defined in:
lib/forms/models/extension.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/forms/models/extension.rb', line 4

def self.included(base)
  base.class_eval do 
    def initialize(form, page, config)
      @form   = form
      @page   = page
      
      @data   = Forms::Config.deep_symbolize_keys(@page.data)
      
      # Sets the config to be the current environment config: checkout:
      @config = config
    end
    
    def current_user
      return @current_user if @current_user.present? 
      @current_user = UserActionObserver.current_user
    end
    
  end
end