Method: Jinda::JindaHelper#create_xmain

Defined in:
app/helpers/jinda_engine/jinda_helper.rb

#create_xmain(service) ⇒ Object

] Each Service at one moment will create one xmain ]



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/helpers/jinda_engine/jinda_helper.rb', line 37

def create_xmain(service)
  c = name2camel(service.module.code)
  custom_controller= "#{c}Controller"
  params["return"] = request.env['HTTP_REFERER']
  Jinda::Xmain.create :service=>service,
    :start=>Time.now,
    :name=>service.name,
    :ip=> get_ip,
    :status=>'I', # init
    :user=>current_ma_user,
    :xvars=> {
      :service_id=>service.id,
      :p=>params.to_unsafe_h,
      :id=>params[:id],
      :user_id=>current_ma_user.try(:id),
      :custom_controller=>custom_controller,
      :host=>request.host,
      :referer=>request.env['HTTP_REFERER']
    }
end