Sha256: afe721e5d72a447b6ac53df4202dc830f6b7531d2398db3bb7b3851f981e2c0c
Contents?: true
Size: 1.27 KB
Versions: 24
Compression:
Stored size: 1.27 KB
Contents
########################################################################] # Each Service at one moment will create one xmain ########################################################################] 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 def clear_xmains Jinda::Xmain.where(:status =>{'$in'=>['R','I']}).update_all(:status=>'X') redirect_to action:"pending" end def ajax_notice if notice=Jinda::Notice.recent(current_ma_user, request.env["REMOTE_ADDR"]) notice.update_attribute :unread, false js = "notice('#{notice.message}');" else js = "" end render plain: "<script>#{js}</script>" end
Version data entries
24 entries across 24 versions & 2 rubygems