Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation message for Spree::CreditCard #3388

Merged

Conversation

spaghetticode
Copy link
Member

Description

Deprecation message on CreditCard#default is a bit misleading, as it
prints out CreditCard.default but it's referencing an instance method
not a class method.

Checklist:

Deprecation messages on `CreditCard#default` and `CreditCard#default=`
are a bit misleading, as they print out `CreditCard.default`
but they are actually referencing an instance method, not a class one.
@spaghetticode spaghetticode self-assigned this Oct 22, 2019
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I wonder if we do this elsewhere. 🤔

@spaghetticode
Copy link
Member Author

@jacobherrington I think this is probably an isolated case, caused by cut & paste from the deprecation of the class method just a few lines above:

    def self.default
      Spree::Deprecation.warn("CreditCard.default is deprecated. Please use Spree::Wallet instead.")
      joins(:wallet_payment_sources).where(spree_wallet_payment_sources: { default: true })
    end

@kennyadsl kennyadsl merged commit d323436 into solidusio:master Oct 24, 2019
@kennyadsl kennyadsl deleted the spaghetticode/fix-deprecation-message branch October 24, 2019 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants