Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Undefined method 'permit' for Hash #103

Open
tamagokun opened this issue Aug 8, 2016 · 1 comment
Open

Undefined method 'permit' for Hash #103

tamagokun opened this issue Aug 8, 2016 · 1 comment

Comments

@tamagokun
Copy link

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)
@gus4no
Copy link

gus4no commented Apr 27, 2017

This is annoying even to write tests :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants