Skip to content

Instantly share code, notes, and snippets.

@hayeah
Created July 3, 2013 01:20
Show Gist options
  • Save hayeah/5914730 to your computer and use it in GitHub Desktop.
Save hayeah/5914730 to your computer and use it in GitHub Desktop.
coupon apply error
A NameError occurred in orders#apply_pf_coupon:
uninitialized constant Puffant::Coupon::InvalidCode
app/controllers/puffant/orders_controller.rb:53:in `rescue in apply_pf_coupon'
-------------------------------
Request:
-------------------------------
* URL : http://www.puffant.com/orders/1579/apply_pf_coupon
* IP address: 120.197.131.35
* Parameters: {"coupon_code"=>"ET01mAhl", "domain"=>"puffant.com", "subdomain"=>"www", "action"=>"apply_pf_coupon", "controller"=>"puffant/orders", "id"=>"1579"}
* Rails root: /pf/deploy/puffant-rails-deploy
* Timestamp : 2013-07-01 08:06:23 UTC
-------------------------------
Session:
-------------------------------
* session id: "b604a8008c6b5f7718ba1e829d24107e"
* data: {"session_id"=>"b604a8008c6b5f7718ba1e829d24107e",
"_csrf_token"=>"L7kdfe64mWAkQ2JWbL9JwEyTdTZw6pmnmWV7bmk0ngg=",
"warden.user.user.key"=>["OauthUser", 5815]}
-------------------------------
Environment:
-------------------------------
* CONTENT_LENGTH : 20
* CONTENT_TYPE : application/x-www-form-urlencoded; charset=UTF-8
* GATEWAY_INTERFACE : CGI/1.2
* HTTP_ACCEPT : */*
* HTTP_ACCEPT_CHARSET : GBK,utf-8;q=0.7,*;q=0.3
* HTTP_ACCEPT_ENCODING : gzip,deflate
* HTTP_ACCEPT_LANGUAGE : zh-CN
* HTTP_CONNECTION : close
* HTTP_COOKIE : org.jboss.seam.security.authtoken=MTA4ODQ2ODgwQHFxLmNvbTotNmU0Yjc1Zjk6MTNmODRjN2NiZjQ6LTdiNDI6LTU2MzcwOTAyODI2ODMwMjcwNzU=; device_id=f6c14b01a1edeb820ea57cef563a6592; _puffant-rails_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiJWI2MDRhODAwOGM2YjVmNzcxOGJhMWU4MjlkMjQxMDdlBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUw3a2RmZTY0bVdBa1EySldiTDlKd0V5VGRUWnc2cG1ubVdWN2JtazBuZ2c9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsHSSIOT2F1dGhVc2VyBjsARmkCtxY%3D--d1024d1f887da2762a84efcc14d0558b0455a27a; CNZZDATA3874300=cnzz_eid%3D1123047377-1372236830-http%253A%252F%252Fwww.puffant.com%26ntime%3D1372665913%26cnzz_a%3D16%26retime%3D1372665927913%26sin%3Dnone%26ltime%3D1372665927913%26rtime%3D2
* HTTP_DNT : 1
* HTTP_HOST : www.puffant.com
* HTTP_ORIGIN : http://www.puffant.com
* HTTP_REFERER : http://www.puffant.com/orders/new_pf_alipay/book/30088
* HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Maxthon/4.1.0.2000 Chrome/26.0.1410.43 Safari/537.1
* HTTP_VERSION : HTTP/1.0
* HTTP_X_CSRF_TOKEN : L7kdfe64mWAkQ2JWbL9JwEyTdTZw6pmnmWV7bmk0ngg=
* HTTP_X_FORWARDED_FOR : 120.197.131.35
* HTTP_X_REAL_IP : 120.197.131.35
* HTTP_X_REQUESTED_WITH : XMLHttpRequest
* ORIGINAL_FULLPATH : /orders/1579/apply_pf_coupon
* PATH_INFO : /orders/1579/apply_pf_coupon
* QUERY_STRING :
* REMOTE_ADDR : 127.0.0.1
* REQUEST_METHOD : POST
* REQUEST_PATH : /orders/1579/apply_pf_coupon
* REQUEST_URI : /orders/1579/apply_pf_coupon
* SCRIPT_NAME :
* SERVER_NAME : www.puffant.com
* SERVER_PORT : 80
* SERVER_PROTOCOL : HTTP/1.1
* SERVER_SOFTWARE : 2.1.1
* action_controller.instance : orders#apply_pf_coupon
* action_dispatch.backtrace_cleaner : #<Rails::BacktraceCleaner:0x00000005320140>
* action_dispatch.cookies : #<ActionDispatch::Cookies::CookieJar:0x00000007627f80>
* action_dispatch.logger : #<ActiveSupport::TaggedLogging:0x000000054bfc08>
* action_dispatch.parameter_filter : [:password, /RAW_POST_DATA/]
* action_dispatch.remote_ip : 120.197.131.35
* action_dispatch.request.accepts : [#<Mime::Type:0x00000009036340 @synonyms=[], @symbol=nil, @string="*/*">]
* action_dispatch.request.content_type : application/x-www-form-urlencoded
* action_dispatch.request.formats : [#<Mime::Type:0x00000009036340 @synonyms=[], @symbol=nil, @string="*/*">]
* action_dispatch.request.parameters : {"coupon_code"=>"ET01mAhl", "domain"=>"puffant.com", "subdomain"=>"www", "action"=>"apply_pf_coupon", "controller"=>"puffant/orders", "id"=>"1579"}
* action_dispatch.request.path_parameters : {:domain=>"puffant.com", :subdomain=>"www", :action=>"apply_pf_coupon", :controller=>"puffant/orders", :id=>"1579"}
* action_dispatch.request.query_parameters : {}
* action_dispatch.request.request_parameters : {"coupon_code"=>"ET01mAhl"}
* action_dispatch.request.unsigned_session_cookie: {"session_id"=>"b604a8008c6b5f7718ba1e829d24107e", "_csrf_token"=>"L7kdfe64mWAkQ2JWbL9JwEyTdTZw6pmnmWV7bmk0ngg=", "warden.user.user.key"=>["OauthUser", 5815]}
* action_dispatch.request_id : a5424fd07ad6b14c6fba6cc48a90fd05
* action_dispatch.routes : #<ActionDispatch::Routing::RouteSet:0x00000003c3b218>
* action_dispatch.secret_token : b9000244c13eb3865df30ed46e20bbbcb454fde9697e5dcf14a687df7b48419dfbfa2ba40d77ccbd3b52ceb8aa194f07e294aa67df3b354e396ba7edb9c11210
* action_dispatch.show_detailed_exceptions : false
* action_dispatch.show_exceptions : true
* exception_notifier.options : {:sender_address=>"\"error\" <[email protected]>", :exception_recipients=>["[email protected]"], :email_prefix=>"[Baolaika] ", :email_format=>:text, :sections=>["request", "session", "environment", "backtrace"], :background_sections=>["backtrace", "data"], :verbose_subject=>true, :normalize_subject=>false, :template_path=>"exception_notifier", :smtp_settings=>nil, :ignore_exceptions=>["ActiveRecord::RecordNotFound", "AbstractController::ActionNotFound", "ActionController::RoutingError"], :ignore_crawlers=>[], :ignore_if=>#<Proc:0x000000075c9bb0@/usr/local/rvm/gems/ruby-2.0.0-p0/gems/exception_notification-3.0.0/lib/exception_notifier.rb:36 (lambda)>}
* puma.config : #<Puma::Configuration:0x0000000279e850>
* puma.socket : #<TCPSocket:0x0000000757fe98>
* rack-cache.allow_reload : false
* rack-cache.allow_revalidate : false
* rack-cache.cache_key : Rack::Cache::Key
* rack-cache.default_ttl : 0
* rack-cache.entitystore : rails:/
* rack-cache.ignore_headers : ["Set-Cookie"]
* rack-cache.metastore : rails:/
* rack-cache.private_headers : ["Authorization", "Cookie"]
* rack-cache.storage : #<Rack::Cache::Storage:0x00000007bb24f0>
* rack-cache.use_native_ttl : false
* rack-cache.verbose : false
* rack.after_reply : []
* rack.errors : #<IO:0x000000018b2148>
* rack.hijack : #<Puma::Client:0x0000000757fe48>
* rack.hijack? : true
* rack.input : #<StringIO:0x00000004991b38>
* rack.multiprocess : false
* rack.multithread : false
* rack.request.cookie_hash : {"org.jboss.seam.security.authtoken"=>"MTA4ODQ2ODgwQHFxLmNvbTotNmU0Yjc1Zjk6MTNmODRjN2NiZjQ6LTdiNDI6LTU2MzcwOTAyODI2ODMwMjcwNzU=", "device_id"=>"f6c14b01a1edeb820ea57cef563a6592", "_puffant-rails_session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiJWI2MDRhODAwOGM2YjVmNzcxOGJhMWU4MjlkMjQxMDdlBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUw3a2RmZTY0bVdBa1EySldiTDlKd0V5VGRUWnc2cG1ubVdWN2JtazBuZ2c9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsHSSIOT2F1dGhVc2VyBjsARmkCtxY=--d1024d1f887da2762a84efcc14d0558b0455a27a", "CNZZDATA3874300"=>"cnzz_eid=1123047377-1372236830-http%3A%2F%2Fwww.puffant.com&ntime=1372665913&cnzz_a=16&retime=1372665927913&sin=none&ltime=1372665927913&rtime=2"}
* rack.request.cookie_string : org.jboss.seam.security.authtoken=MTA4ODQ2ODgwQHFxLmNvbTotNmU0Yjc1Zjk6MTNmODRjN2NiZjQ6LTdiNDI6LTU2MzcwOTAyODI2ODMwMjcwNzU=; device_id=f6c14b01a1edeb820ea57cef563a6592; _puffant-rails_session=BAh7CEkiD3Nlc3Npb25faWQGOgZFVEkiJWI2MDRhODAwOGM2YjVmNzcxOGJhMWU4MjlkMjQxMDdlBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMUw3a2RmZTY0bVdBa1EySldiTDlKd0V5VGRUWnc2cG1ubVdWN2JtazBuZ2c9BjsARkkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsHSSIOT2F1dGhVc2VyBjsARmkCtxY%3D--d1024d1f887da2762a84efcc14d0558b0455a27a; CNZZDATA3874300=cnzz_eid%3D1123047377-1372236830-http%253A%252F%252Fwww.puffant.com%26ntime%3D1372665913%26cnzz_a%3D16%26retime%3D1372665927913%26sin%3Dnone%26ltime%3D1372665927913%26rtime%3D2
* rack.request.form_hash : {"coupon_code"=>"ET01mAhl"}
* rack.request.form_input : #<StringIO:0x00000004991b38>
* rack.request.form_vars : coupon_code=ET01mAhl
* rack.request.query_hash : {}
* rack.request.query_string :
* rack.run_once : false
* rack.session : {"session_id"=>"b604a8008c6b5f7718ba1e829d24107e", "_csrf_token"=>"L7kdfe64mWAkQ2JWbL9JwEyTdTZw6pmnmWV7bmk0ngg=", "warden.user.user.key"=>["OauthUser", 5815]}
* rack.session.options : {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :secret=>"9a8fb773209829f26c70a9f0f6565d92f512f11739015289b721d445d85c", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x000000075c9610>, :id=>"b604a8008c6b5f7718ba1e829d24107e"}
* rack.url_scheme : http
* rack.version : [1, 1]
* warden : Warden::Proxy:61981280 @config={:default_scope=>:admin_user, :scope_defaults=>{}, :default_strategies=>{:admin_user=>[:rememberable, :database_authenticatable], :user=>[:rememberable, :token_authenticatable, :database_authenticatable]}, :intercept_401=>false, :failure_app=>#<Devise::Delegator:0x000000081b1a90>}
* Process: 19794
* Server : 10-4-7-97
-------------------------------
Backtrace:
-------------------------------
app/controllers/puffant/orders_controller.rb:53:in `rescue in apply_pf_coupon'
app/controllers/puffant/orders_controller.rb:43:in `apply_pf_coupon'
actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.13) lib/active_support/callbacks.rb:447:in `_run__158029348380648186__process_action__4107625927703730340__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
omniauth (1.1.1) lib/omniauth/builder.rb:48:in `call'
exception_notification (3.0.0) lib/exception_notifier.rb:40:in `call'
vendor/cache/rubyamf-03dbc3d60bdd/lib/rubyamf/rails/request_processor.rb:13:in `call'
vendor/cache/rubyamf-03dbc3d60bdd/lib/rubyamf/request_parser.rb:31:in `call'
sass (3.2.8) lib/sass/plugin/rack.rb:54:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__329756255452678640__call__562989542080940503__callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.13) lib/rails/engine.rb:479:in `call'
railties (3.2.13) lib/rails/application.rb:223:in `call'
railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing'
puma (2.1.1) lib/puma/configuration.rb:66:in `call'
puma (2.1.1) lib/puma/server.rb:369:in `handle_request'
puma (2.1.1) lib/puma/server.rb:246:in `process_client'
puma (2.1.1) lib/puma/server.rb:145:in `block in run'
puma (2.1.1) lib/puma/thread_pool.rb:92:in `call'
puma (2.1.1) lib/puma/thread_pool.rb:92:in `block in spawn_thread'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment