spree/spree — Issue #981: build_source in payment dependent on hash order
Author: rounders
Created: 2012-01-17 09:32:15+00:00
State: open

the build_source method in the Spree::Payment class can fail to build the source association depending on the order of the source Hash passed into Payment.new and depending on the version of Ruby and how it handles hash ordering.

Whether or not payment_method is nil within the build_source method depends on whether the payment_method setter was called before the source_attributes setter and this can depend on the order of the Hash passed into Payment.new

Please see the following gist for an example test that I ran against spree 1.0.0.rc2 under various ruby versions:
https://gist.github.com/1625808