mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
As detailed in issue #119, we've somewhat unfortunately been allowing object attributes to be passed in during a #save because we mix any arguments directly into the serialized hash (it seems that this was originally intended to be used more for meta parameters that go to the request). As also noted in #119, this use causes problems when certain types of parameters (like subobjects) are used. We're now left in the somewhat awkward position of either: 1. Removing this functionality on #save and breaking what may be behavior that people depend on. 2. Fully support this mass assignment. This patch takes the second path by extracting a new #update_attributes method and using it from #save. It's still far from a perfect approach because keys that have the same name as certain options (e.g. `req_url`) are not going to work, but it should capture the behavior that most people want. Fixes #119.