spree-contrib / spree_drop_ship

Spree Drop Shipping Extension
BSD 3-Clause "New" or "Revised" License
104 stars 120 forks source link

Strong Paramaters #35

Closed mdundas closed 10 years ago

mdundas commented 10 years ago

Basic model changes to get drop_ship working in Spree 2.1 with Strong Parameters enabled.

Tested on Spree 2.1.3:

Not Working:

/admin/suppliers/mysupplier/edit

But the drop_ship controller won't respond to these. I changed this links to use ids instead. i.e.:

/admin/suppliers/10/edit

This works great. However i'm not including the change in this PR b/c i figure you want to stick with permalinks.

cheers, matt

JDutil commented 10 years ago

The supplier edit/delete links not working must be related to a change in friendly_id between v4 and v5.

Assigning stock locations to a supplier could be done the same way products are: https://github.com/jdutil/spree_drop_ship/blob/master/app/controllers/spree/admin/products_controller_decorator.rb#L5-L18

JDutil commented 10 years ago

Trying to run rake test_app I receive:

rake aborted!
uninitialized constant FriendlyId::ActiveRecord
/Users/JDutil/Code/spree_drop_ship/lib/spree_drop_ship.rb:2:in `require'
/Users/JDutil/Code/spree_drop_ship/lib/spree_drop_ship.rb:2:in `<top (required)>'
/Users/JDutil/Code/spree_drop_ship/Rakefile:14:in `block in <top (required)>'
Tasks: TOP => common:test_app
(See full trace by running task with --trace)
mdundas commented 10 years ago

I plan on fixing the Stock Location <-> Supplier issue and i'd be happy to share the fix. But i don't have time to troubleshoot friendly_id upgrade issues... I'm no longer dependent on this gem in my code base :)

JDutil commented 10 years ago

I have a fix for the friend_id finding of supplier links, and can implement the stock location assignment easy enough. Just need to figure out this activerecord error, and will get this stuff merged in.

JDutil commented 10 years ago

Thanks I've merged the work in. Please try out the stock location and edit supplier link bugs again as those should be fixed as well. Still tons of Rails 4 deprecations and things to cleanup, but looking good. Thanks @mdundas :beers:

mdundas commented 10 years ago

No problem. This project has saved me tons of time, i'll let you know if the fixes work...

mdundas commented 10 years ago

Confirmed: The supplier links & Stock Location issues look fixed...