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

Improve PaymentMethod docs and add some deprecations #2650

Merged
merged 5 commits into from
Mar 28, 2018

Conversation

jhawthorn
Copy link
Contributor

This deprecates some things that I don't think should be used:

  • PaymentMethod::DISPLAY (shouldn't be useful anymore)
  • .active?, which we weren't using and I think is more readable as .active.any?
  • find_with_destroyed, which we weren't using and I think is more readable as .with_deleted.find

This fixes the yard syntax and properly marks the deprecated methods as deprecated

def find_with_destroyed(*args)
Spree::Deprecation.warn "#{to_s}.find_with_destroyed is deprecated. Use #{to_s}.with_deleted.find instead"

Choose a reason for hiding this comment

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

Use self instead of Object#to_s in interpolation.

def active?
Spree::Deprecation.warn "#{to_s}.active? is deprecated. Use #{to_s}.active.any? instead"

Choose a reason for hiding this comment

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

Use self instead of Object#to_s in interpolation.

Copy link
Member

@gmacdougall gmacdougall left a comment

Choose a reason for hiding this comment

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

Thanks John

jhawthorn and others added 5 commits March 28, 2018 13:03
We were only using it from a helper, which is unnecessary now that the
payment.payment_method association includes deleted payment methods.
@jhawthorn jhawthorn force-pushed the payment_methods_docs branch from e2e6901 to aaed1ec Compare March 28, 2018 20:04
@jhawthorn jhawthorn merged commit 660ffe9 into solidusio:master Mar 28, 2018
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.

3 participants