Skip to content

Commit

Permalink
[API] Remove deprecated ApiHelpers::ATTRIBUTES
Browse files Browse the repository at this point in the history
Please use Spree::Api::Config now.

Ref solidusio#4039
  • Loading branch information
kennyadsl committed Mar 27, 2023
1 parent d9c4782 commit 749e7f5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
45 changes: 0 additions & 45 deletions api/app/helpers/spree/api/api_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,6 @@
module Spree
module Api
module ApiHelpers
ATTRIBUTES = [
:product_attributes,
:product_property_attributes,
:variant_attributes,
:image_attributes,
:option_value_attributes,
:order_attributes,
:line_item_attributes,
:option_type_attributes,
:payment_attributes,
:payment_method_attributes,
:shipment_attributes,
:taxonomy_attributes,
:taxon_attributes,
:address_attributes,
:country_attributes,
:state_attributes,
:adjustment_attributes,
:inventory_unit_attributes,
:customer_return_attributes,
:return_authorization_attributes,
:creditcard_attributes,
:payment_source_attributes,
:user_attributes,
:property_attributes,
:stock_location_attributes,
:stock_movement_attributes,
:stock_item_attributes,
:promotion_attributes,
:store_attributes,
:store_credit_history_attributes,
:variant_property_attributes
]

ATTRIBUTES.each do |attribute|
define_method attribute do
Spree::Api::Config.send(attribute)
end

define_singleton_method attribute do
Spree::Deprecation.warn("Please use Spree::Api::Config::#{attribute} instead.")
Spree::Api::Config.send(attribute)
end
end

def required_fields_for(model)
required_fields = model._validators.select do |_field, validations|
validations.any? { |validation| validation.is_a?(ActiveModel::Validations::PresenceValidator) }
Expand Down
16 changes: 0 additions & 16 deletions api/spec/helpers/api_helpers_spec.rb

This file was deleted.

0 comments on commit 749e7f5

Please sign in to comment.