spree_address_book
spree_address_book copied to clipboard
Undefined method 'permit' for Hash
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)
This is annoying even to write tests :/