Payment method preferences returns different object types depending on setup #4584
seand7565
started this conversation in
New Features or Ideas
Replies: 1 comment
-
Using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When setting up a payment_method, if you don't use static model preferences, you get a Hash object when you call
payment_method.preferences
. If you do use static model preferences, you instead get aSpree::Preferences::StaticModelPreferences::Definition
object when you callpayment_method.preferences
While using the default preference source, this command will succeed:
payment_method.preferences[:available_to_users]
While using static model preferences, the same command will fail.
Solidus Version:
2.10 - though likely an issue in more versions
To Reproduce
Spree::PaymentMethod.last.preferences[:test_mode]
- it will failSpree::PaymentMethod.last.preferences[:test_mode]
- it will succeedExample static model preference:
Current behavior
payment_method.preferences
could return either a Hash or a model object depending on the setupExpected behavior
payment_method.preferences
should always return just one object type - IMO preferably a Hash object.Screenshots
Beta Was this translation helpful? Give feedback.
All reactions