Skip to content

Fix linting errors #6240

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

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4796d16
Remove Rubocop.yml deprecation warnings
mamhoff May 28, 2025
3d0df68
Update validation syntax
mamhoff May 21, 2025
abfa512
Replace `puts` in tasks and generators with Rails.logger
mamhoff May 21, 2025
b133f7f
Refactor load_user_roles into current_user_roles helper
mamhoff May 21, 2025
3c629ad
Refactor "current_api_user" into instacached helper
mamhoff May 21, 2025
e63b830
UserAddress: Add dependent/inverse_of options
mamhoff May 28, 2025
e29db18
UserMethods: Add dependent/inverse_of to relations
mamhoff May 28, 2025
da5c067
AdjustmentReason: Add :dependent option
mamhoff May 28, 2025
eb8eb2a
Country: Add dependent/inverse_of options
mamhoff May 28, 2025
b0fd9a1
CustomerReturn: Add dependent option to has_many's
mamhoff May 28, 2025
f3e9a4f
Inventory Unit: Add inverse_of/dependent options
mamhoff May 28, 2025
907309e
Credit Card: Specify inverse_of for :user association
mamhoff May 28, 2025
e566086
Line Item: Specify dependent option for inventory units
mamhoff May 28, 2025
398b401
Order: Add inverse_of/dependent options
mamhoff May 28, 2025
8db61db
Payment Method: Add :dependent options
mamhoff May 28, 2025
8588b90
Payment: Add dependent: :destroy
mamhoff May 28, 2025
5123e21
Payment Source: Add dependent: :restrict_with_error
mamhoff May 28, 2025
378e325
PermissionSet: Add dependent: :destroy
mamhoff May 28, 2025
5ada7c8
StockLocation: Add dependent: :restrict_with_error
mamhoff May 28, 2025
0715fa8
Store Credits: Add dependent: options
mamhoff May 28, 2025
639c808
UserAddress: Add :inverse_of option
mamhoff May 28, 2025
35d104d
Variant: Add inverse_of and dependent options
mamhoff May 28, 2025
59e3cbd
Price: Add inverse_of options
mamhoff May 28, 2025
260fe3d
Product: Add dependent: options
mamhoff May 28, 2025
238d4aa
Reimbursements and returns: Specify dependent/inverse_ofs
mamhoff May 28, 2025
b40408d
Shipment: Add dependent: :destroy
mamhoff May 28, 2025
c2a03e0
Shipping Method: Add dependent: / inverse_of: options
mamhoff May 28, 2025
8541702
Stock Item: Add dependent: :destroy
mamhoff May 28, 2025
ddea5f5
Store: Add dependent: options
mamhoff May 28, 2025
889c751
Tax Rate: Add dependent: :restrict_with_error
mamhoff May 28, 2025
e96af0c
Shipping Category: Add dependent: options
mamhoff May 28, 2025
c853f3a
Move Taxon -> Promotion Rule association to legacy promotions
mamhoff May 28, 2025
0079516
Taxonomy: Add dependent: false options
mamhoff May 28, 2025
61d17c6
Legacy Promotions: Add inverse_of/dependent options
mamhoff May 28, 2025
a51058c
Disable Rails/LexicallyScopedActionFilter
mamhoff May 28, 2025
d9c3f77
Backend: Disable Rails/HelperInstanceVariable cop
mamhoff May 28, 2025
41c66d1
Ignore Rails/Exit warning in rescue clause
mamhoff May 28, 2025
998621e
Promotions: Specify inverse_of/dependent options
mamhoff May 28, 2025
6ca7f71
Fix taxon patch
mamhoff May 28, 2025
e1dc7b6
Aktualisieren von spree_taxon_patch.rb
mamhoff May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/app/models/spree/adjustment_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Spree
class AdjustmentReason < Spree::Base
has_many :adjustments, inverse_of: :adjustment_reason
has_many :adjustments, inverse_of: :adjustment_reason, dependent: :restrict_with_exception
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using restrict_with_error instead? So that we can display the error message on the record we try do delete instead of rendering a 500 in the admin. Otherwise we would need to rescue_from ActiveRecord::DeleteRestrictionError in the backend.


validates :name, presence: true, uniqueness: { case_sensitive: false, allow_blank: true }
validates :code, presence: true, uniqueness: { case_sensitive: false, allow_blank: true }
Expand Down