solidusio / rubocop-solidus

Automatic Solidus code style checking tool.
MIT License
4 stars 4 forks source link

New cop to warn about `existing_card_id` usage #62

Closed MassimilianoLattanzio closed 1 year ago

MassimilianoLattanzio commented 1 year ago

Description

Create a new cop to find existing_card_id occurrences and suggest using wallet_payment_source_id instead.

Closes #60.


Severity:


Wrong Code

source_attributes: {
  name: payment_method.name,
  existing_card_id: payment_source.id
}

Correct Code

source_attributes: {
  name: payment_method.name,
  wallet_payment_source_id: payment_source.wallet.wallet_payment_sources.first.id
}

Solidus PR Link: https://github.com/solidusio/solidus/pull/3818/commits/eacc898d0bb745590cbf46e0740feebd3a7361a2


Before submitting the PR make sure the following are checked: