Closed mhelfer closed 10 years ago
This extension hasn't been fully updated for Spree 2.1.x yet. The controllers need to have the strong_params updates for rails 4 implemented still if you can work on a PR before I get to it.
Running the gem locally it appears to be caused by cancan. I followed the advice of this thread: https://github.com/ryanb/cancan/issues/835#issuecomment-18663815
By modifying the suppliers_controller, it solved my problem.
Feels like a little bit of a hack, and haven't confirmed if it is happening with any more of the controllers. I'll see if I can't put together a pull request.
FYI for anybody else having this problem.
Could you at least provide a link to the comparison of your branch vs master branch that fixes the problem? would like to see what you did to resolve the error even if it can't be worked back into master branch of this ext.
I forked your repo and made the following changes so I could test them. Here is the commit that I used to correct both the issues 37 and 36.
https://github.com/mhelfer/spree_drop_ship/commit/45b47f0fceb095c78cb3dad2f5ef667858f23370
Mike
I am running the drop ship gem (master branch) with Spree 2-1-stable. When I enable supplier signup, and then actually try to sign up to be a supplier I get the below error related to strong parameter assignment:
Path: /suppliers/new
Error: ActiveModel::ForbiddenAttributesError
Trace: activemodel (4.0.0) lib/active_model/forbidden_attributes_protection.rb:21:in'
sanitize_for_mass_assignment' activerecord (4.0.0) lib/active_record/attribute_assignment.rb:21:in
assign_attributes' activerecord (4.0.0) lib/active_record/core.rb:192:ininitialize' activerecord (4.0.0) lib/active_record/inheritance.rb:27:in
new' activerecord (4.0.0) lib/active_record/inheritance.rb:27:innew' /Users/michaelhelfer/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree_drop_ship-09349f9e3e09/app/controllers/spree/suppliers_controller.rb:22:in
create' actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.0.0) lib/abstract_controller/base.rb:189:in
process_action' actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in
block in process_action' activesupport (4.0.0) lib/active_support/callbacks.rb:463:in_run__2315432672199375350__process_action__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in
run_callbacks' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:inprocess_action' actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in
process_action' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:inblock in process_action' activesupport (4.0.0) lib/active_support/notifications.rb:159:in
block in instrument' activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.0.0) lib/active_support/notifications.rb:159:in
instrument' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in
process_action' activerecord (4.0.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (4.0.0) lib/abstract_controller/base.rb:136:in
process' actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:inprocess' actionpack (4.0.0) lib/action_controller/metal.rb:195:in
dispatch' actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:indispatch' actionpack (4.0.0) lib/action_controller/metal.rb:231:in
block in action' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:incall' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in
dispatch' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:incall' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in
block in call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:ineach' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in
call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:incall' railties (4.0.0) lib/rails/engine.rb:511:in
call' railties (4.0.0) lib/rails/railtie/configurable.rb:30:inmethod_missing' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in
block in call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:ineach' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in
call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:incall' omniauth (1.1.4) lib/omniauth/strategy.rb:184:in
call!' omniauth (1.1.4) lib/omniauth/strategy.rb:164:incall' omniauth (1.1.4) lib/omniauth/strategy.rb:184:in
call!' omniauth (1.1.4) lib/omniauth/strategy.rb:164:incall' omniauth (1.1.4) lib/omniauth/strategy.rb:184:in
call!' omniauth (1.1.4) lib/omniauth/strategy.rb:164:incall' omniauth (1.1.4) lib/omniauth/strategy.rb:184:in
call!' omniauth (1.1.4) lib/omniauth/strategy.rb:164:incall' warden (1.2.3) lib/warden/manager.rb:35:in
block in call' warden (1.2.3) lib/warden/manager.rb:34:incatch' warden (1.2.3) lib/warden/manager.rb:34:in
call' rack (1.5.2) lib/rack/etag.rb:23:incall' rack (1.5.2) lib/rack/conditionalget.rb:35:in
call' rack (1.5.2) lib/rack/head.rb:11:incall' actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in
call' actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:incall' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in
context' rack (1.5.2) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in
call' activerecord (4.0.0) lib/active_record/query_cache.rb:36:incall' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
call' activerecord (4.0.0) lib/active_record/migration.rb:369:incall' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in
block in call' activesupport (4.0.0) lib/active_support/callbacks.rb:373:in_run__61129833526744053__call__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in
run_callbacks' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in
call' actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:incall' actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
call' actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.0.0) lib/rails/rack/logger.rb:38:in
call_app' railties (4.0.0) lib/rails/rack/logger.rb:21:inblock in call' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in
block in tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:intagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in
tagged' railties (4.0.0) lib/rails/rack/logger.rb:21:incall' actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in
call' rack (1.5.2) lib/rack/methodoverride.rb:21:incall' rack (1.5.2) lib/rack/runtime.rb:17:in
call' activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:incall' rack (1.5.2) lib/rack/lock.rb:17:in
call' actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:incall' railties (4.0.0) lib/rails/engine.rb:511:in
call' railties (4.0.0) lib/rails/application.rb:97:incall' rack (1.5.2) lib/rack/content_length.rb:14:in
call' thin (1.6.1) lib/thin/connection.rb:82:inblock in pre_process' thin (1.6.1) lib/thin/connection.rb:80:in
catch' thin (1.6.1) lib/thin/connection.rb:80:inpre_process' thin (1.6.1) lib/thin/connection.rb:55:in
process' thin (1.6.1) lib/thin/connection.rb:41:inreceive_data' eventmachine (1.0.3) lib/eventmachine.rb:187:in
run_machine' eventmachine (1.0.3) lib/eventmachine.rb:187:inrun' thin (1.6.1) lib/thin/backends/base.rb:73:in
start' thin (1.6.1) lib/thin/server.rb:162:instart' rack (1.5.2) lib/rack/handler/thin.rb:16:in
run' rack (1.5.2) lib/rack/server.rb:264:instart' railties (4.0.0) lib/rails/commands/server.rb:84:in
start' railties (4.0.0) lib/rails/commands.rb:78:inblock in <top (required)>' railties (4.0.0) lib/rails/commands.rb:73:in
tap' railties (4.0.0) lib/rails/commands.rb:73:in<top (required)>' bin/rails:4:in
require' bin/rails:4:in<top (required)>' -e:1:in
load' -e:1:in `Parameters:
{"utf8"=>"✓", "authenticity_token"=>"qE5zBRiiZxRix9vdxhIdIzY3amtxncfggVp9eCHQgmQ=", "supplier"=>{"name"=>"Test", "merchant_type"=>"individual"}, "commit"=>"Sign Up"}