Skip to content

Commit af449d9

Browse files
mamhofftvdeyen
authored andcommitted
Fix Rubocop offenses
1 parent 8d921d9 commit af449d9

File tree

5 files changed

+20
-22
lines changed

5 files changed

+20
-22
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Layout/EmptyLinesAroundAttributeAccessor:
9292
- "core/app/models/spree/stock_quantities.rb"
9393
- "core/app/models/spree/variant.rb"
9494
- "core/lib/spree/app_configuration.rb"
95-
- "core/lib/spree/permission_sets/base.rb"
9695
- "core/lib/spree/preferences/configuration.rb"
9796
- "core/spec/lib/spree/core/validators/email_spec.rb"
9897
- "core/spec/models/spree/preferences/statically_configurable_spec.rb"
@@ -145,7 +144,6 @@ Layout/MultilineOperationIndentation:
145144
Exclude:
146145
- "core/lib/spree/core/engine.rb"
147146
- "core/lib/spree/core/importer/order.rb"
148-
- "core/lib/spree/permission_sets/default_customer.rb"
149147
- "core/lib/spree/testing_support/factories/address_factory.rb"
150148

151149
# Offense count: 3
@@ -525,7 +523,6 @@ Style/CommentAnnotation:
525523
- "backend/app/controllers/spree/admin/products_controller.rb"
526524
- "backend/app/controllers/spree/admin/resource_controller.rb"
527525
- "core/app/models/spree/payment_method/store_credit.rb"
528-
- "core/lib/spree/permission_sets/user_management.rb"
529526
- "core/lib/spree/testing_support/rake.rb"
530527
- "core/spec/models/spree/variant/scopes_spec.rb"
531528

core/app/models/spree/permission_sets/base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def self.category
3838
private
3939

4040
attr_reader :ability
41+
4142
delegate :can, :cannot, :user, to: :ability
4243
end
4344
end

core/app/models/spree/permission_sets/configuration_display.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ def category
3333
end
3434

3535
def activate!
36-
can [:read, :admin], Spree::TaxCategory
37-
can [:read, :admin], Spree::TaxRate
38-
can [:read, :admin], Spree::Zone
39-
can [:read, :admin], Spree::Country
40-
can [:read, :admin], Spree::State
41-
can [:read, :admin], Spree::PaymentMethod
42-
can [:read, :admin], Spree::Taxonomy
43-
can [:read, :admin], Spree::ShippingMethod
44-
can [:read, :admin], Spree::ShippingCategory
45-
can [:read, :admin], Spree::StockLocation
46-
can [:read, :admin], Spree::StockMovement
47-
can [:read, :admin], Spree::RefundReason
48-
can [:read, :admin], Spree::ReimbursementType
49-
can [:read, :admin], Spree::ReturnReason
36+
can [:read, :admin], Spree::TaxCategory
37+
can [:read, :admin], Spree::TaxRate
38+
can [:read, :admin], Spree::Zone
39+
can [:read, :admin], Spree::Country
40+
can [:read, :admin], Spree::State
41+
can [:read, :admin], Spree::PaymentMethod
42+
can [:read, :admin], Spree::Taxonomy
43+
can [:read, :admin], Spree::ShippingMethod
44+
can [:read, :admin], Spree::ShippingCategory
45+
can [:read, :admin], Spree::StockLocation
46+
can [:read, :admin], Spree::StockMovement
47+
can [:read, :admin], Spree::RefundReason
48+
can [:read, :admin], Spree::ReimbursementType
49+
can [:read, :admin], Spree::ReturnReason
5050
end
5151
end
5252
end

core/app/models/spree/permission_sets/default_customer.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def activate!
4949
can :create, Order do |order, token|
5050
# same user, or both nil
5151
order.user == user ||
52-
# guest checkout order
53-
order.email.present? ||
54-
# via API, just like with show and update
55-
(order.guest_token.present? && token == order.guest_token)
52+
# guest checkout order
53+
order.email.present? ||
54+
# via API, just like with show and update
55+
(order.guest_token.present? && token == order.guest_token)
5656
end
5757
can [:show, :update], Order, Order.where(user:) do |order, token|
5858
order.user == user || (order.guest_token.present? && token == order.guest_token)

core/app/models/spree/permission_sets/user_management.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def category
2525
def activate!
2626
can [:admin, :read, :create, :update, :save_in_address_book, :remove_from_address_book, :addresses, :orders, :items], Spree.user_class
2727

28-
# Note: This does not work with accessible_by.
28+
# NOTE: This does not work with accessible_by.
2929
# See https://github.com/solidusio/solidus/pull/1263
3030
can :update_email, Spree.user_class do |user|
3131
user.spree_roles.none?

0 commit comments

Comments
 (0)