spree_address_book icon indicating copy to clipboard operation
spree_address_book copied to clipboard

Undefined method 'permit' for Hash

Open tamagokun opened this issue 8 years ago • 1 comments

Using Spree 3.1.0

Looking at https://github.com/spree-contrib/spree_address_book/blob/master/app/models/spree/order_decorator.rb#L76

when this method is getting passed attributes for an address, it is just a simple Hash of attributes, not a Parameters object from the controller. Wrapping the hash in ActionController::Parameters.new fixes this, but not sure if that is the fix.

    attributes = ActionController::Parameters.new(attributes.select{|k,v| v.present?}).permit(permitted_address_attributes)

tamagokun avatar Aug 08 '16 19:08 tamagokun

This is annoying even to write tests :/

gus4no avatar Apr 27 '17 23:04 gus4no