Your has_one :paypal_transaction
association is most likely the cause of the problem.
It is expecting that there is a foreign key attribute on your PaypalTransaction
class pointing to the PaypalTransactionResponse
and it is guessing that this attribute is called paypal_transaction_response_id
.
If you define your has_one
like:
has_one :paypal_transaction, foreign_key: "response"
Then that should, hopefully, solve the problem.
The reason why it now fails in rails 4.1 is that writing of arbitrary attributes is no longer supported (you can't do my_obj[:my_att] = 42
). I suspect that the code was no erroring in 4.0.5 but maybe wasn't working entirely as you'd expect - or at least you were getting away with it not working correctly.