diff --git a/CHANGELOG.md b/CHANGELOG.md index ece96da..828d951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ ### New features * [#25](https://github.com/solidusio/rubocop-solidus/issues/25): Add solidus/tax_category_deprecated warning cop. ([@safafa][]) +### Bug fixes + +* [#53](https://github.com/solidusio/rubocop-solidus/pull/53): Change spree_default_credit_card_deperecated cop severity to warning. ([@safafa][]) ## 0.2.0 (2023-11-02) diff --git a/docs/cops_solidus.md b/docs/cops_solidus.md index f8786d9..9b0a79b 100644 --- a/docs/cops_solidus.md +++ b/docs/cops_solidus.md @@ -164,7 +164,7 @@ Spree::Calculator::PriceSack Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged | Required Solidus Version --- | --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.1 | - | 2.2 +Enabled | Yes | No | 0.1 | - | 2.2 This cop finds user.default_credit_card suggest using user.wallet.default_wallet_payment_source. diff --git a/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb b/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb index d7f34ec..27ca95a 100644 --- a/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb +++ b/lib/rubocop/cop/solidus/spree_default_credit_card_deprecated.rb @@ -14,7 +14,6 @@ module Solidus # user.wallet.default_wallet_payment_source # class SpreeDefaultCreditCardDeprecated < Base - extend AutoCorrector include TargetSolidusVersion minimum_solidus_version 2.2 @@ -27,9 +26,7 @@ class SpreeDefaultCreditCardDeprecated < Base def on_send(node) return unless default_credit_card?(node) - add_offense(node) do |corrector| - corrector.replace(node, node.source.gsub('default_credit_card', 'wallet.default_wallet_payment_source')) - end + add_offense(node, severity: :warning) end end end