docs/cops_solidus.md in rubocop-solidus-0.1.4 vs docs/cops_solidus.md in rubocop-solidus-0.2.0

- old
+ new

@@ -2,11 +2,11 @@ ## Solidus/ClassEvalDecorator Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | No | 0.1.0 | - | - +Enabled | Yes | No | 0.1 | - | - Solidus suggests a decorator module instead of `class_eval` when overriding some features. This cop finds any `class_eval` and asks to use a decorator module instead. More info: https://guides.solidus.io/customization/customizing-the-core. @@ -30,15 +30,43 @@ ### References * [https://github.com/solidusio/rubocop-solidus/issues/21](https://github.com/solidusio/rubocop-solidus/issues/21) +## Solidus/ExistingCardIdDeprecated + +Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version +--- | --- | --- | --- | --- | --- +Enabled | Yes | No | 0.2 | - | 2.2 + +This cop finds existing_card_id occurrences and suggest using wallet_payment_source_id instead. + +### Examples + +```ruby +# bad +{ + name: payment_method.name, + existing_card_id: payment_source.id +} + +# good +{ + name: payment_method.name, + wallet_payment_source_id: payment_source.wallet.wallet_payment_sources.first.id +} +``` + +### References + +* [https://github.com/solidusio/rubocop-solidus/issues/60](https://github.com/solidusio/rubocop-solidus/issues/60) + ## Solidus/ReimbursementHookDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | No | 0.1.0 | - | 2.11 +Enabled | Yes | No | 0.1 | - | 2.11 This cop finds reimbursement_success_hooks and reimbursement_failed_hooks calls and asks to remove them and subscribe to reimbursement_reimbursed event instead. ### Examples @@ -64,11 +92,11 @@ ## Solidus/SpreeCalculatorFreeShippingDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | No | 0.1.0 | - | - +Enabled | Yes | No | 0.1 | - | - This cop finds Spree::Calculator::FreeShipping calls. This cop is needed as they have been deprecated in future version. ### Examples @@ -86,11 +114,11 @@ ## Solidus/SpreeCalculatorPercentPerItemDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1.0 | - | - +Enabled | Yes | Yes | 0.1 | - | - This cop finds Spree::Calculator::PercentPerItem calls. This cop is needed as they have been deprecated in future version. ### Examples @@ -109,11 +137,11 @@ ## Solidus/SpreeCalculatorPriceSackDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | No | 0.1.0 | - | - +Enabled | Yes | No | 0.1 | - | - This cop finds Spree::Calculator::PriceSack calls. This cop is needed as they have been deprecated in future version. ### Examples @@ -131,11 +159,11 @@ ## Solidus/SpreeDefaultCreditCardDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1.0 | - | 2.2 +Enabled | Yes | Yes | 0.1 | - | 2.2 This cop finds user.default_credit_card suggest using user.wallet.default_wallet_payment_source. ### Examples @@ -153,11 +181,11 @@ ## Solidus/SpreeGatewayBogusDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1.0 | - | 2.1 +Enabled | Yes | Yes | 0.1 | - | 2.1 This cop finds Spree::Gateway::Bogus calls and replaces them with the Spree::PaymentMethod::BogusCreditCard. This cop is needed as the Spree::Gateway::Bogus has been deprecated in future version. ### Examples @@ -180,11 +208,11 @@ ## Solidus/SpreeIconDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1.0 | - | 2.3 +Enabled | Yes | Yes | 0.1 | - | 2.3 This cop finds icon helper calls and suggest using solidus_icon. ### Examples @@ -202,11 +230,11 @@ ## Solidus/SpreeRefundCallPerform Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | No | 0.1.0 | - | 2.11 +Enabled | Yes | No | 0.1 | - | 2.11 This cop finds Spree::Refund.create(your: attributes) calls and replaces them with the Spree::Refund.create(your: attributes, perform_after_create: false).perform! call. ### Examples @@ -225,10 +253,10 @@ ## Solidus/SpreeTDeprecated Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1.0 | - | - +Enabled | Yes | Yes | 0.1 | - | - This cop finds Spree.t method calls and replaces them with the I18n,t method call. This cop is needed as the Spree.t version has been deprecated in future version. ### Examples