Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix rubocop issues.

Sebastian Palma3787537e4f28
diff --git a/api/app/models/concerns/spree/webhooks/has_webhooks.rb b/api/app/models/concerns/spree/webhooks/has_webhooks.rb
index 479d3699cd..91aa3fd481 100644
--- a/api/app/models/concerns/spree/webhooks/has_webhooks.rb
+++ b/api/app/models/concerns/spree/webhooks/has_webhooks.rb
@@ -30,7 +30,7 @@ module Spree
def payload
resource_serializer.new(self).serializable_hash
- rescue NameError, NoMethodError
+ rescue NameError
{}
end
diff --git a/api/app/services/spree/webhooks/endpoints/make_request.rb b/api/app/services/spree/webhooks/endpoints/make_request.rb
index f5f5c5408c..54681d8d10 100644
--- a/api/app/services/spree/webhooks/endpoints/make_request.rb
+++ b/api/app/services/spree/webhooks/endpoints/make_request.rb
@@ -4,11 +4,13 @@ module Spree
class MakeRequest
prepend Spree::ServiceModule::Base
+ # rubocop:disable Lint/UnusedMethodArgument
def call(body:, url:)
return failure(false) if body == ''
run :make_request
end
+ # rubocop:enable Lint/UnusedMethodArgument
private
diff --git a/core/app/validators/url_validator.rb b/core/app/validators/url_validator.rb
index 6b5a02d60a..8c96d009fd 100644
--- a/core/app/validators/url_validator.rb
+++ b/core/app/validators/url_validator.rb
@@ -16,6 +16,6 @@ class UrlValidator < ActiveModel::EachValidator
rescue URI::InvalidURIError
return false
end
- uri.host.present? && uri.kind_of?(URI::HTTP)
+ uri.host.present? && uri.is_a?(URI::HTTP)
end
end