Sha256: b641953d5b04007911f480a95cc797a3858373248035a569873575facea8e86c

Contents?: true

Size: 1.86 KB

Versions: 43

Compression:

Stored size: 1.86 KB

Contents

module Spree
  module Core
    module ControllerHelpers
      module StrongParameters
        def permitted_attributes
          Spree::PermittedAttributes
        end

        delegate(*Spree::PermittedAttributes::ATTRIBUTES,
                 to: :permitted_attributes,
                 prefix: :permitted)

        def permitted_credit_card_update_attributes
          permitted_attributes.credit_card_update_attributes + [
            address_attributes: permitted_address_attributes
          ]
        end

        def permitted_payment_attributes
          permitted_attributes.payment_attributes + [
            source_attributes: permitted_source_attributes
          ]
        end

        def permitted_source_attributes
          permitted_attributes.source_attributes + [
            address_attributes: permitted_address_attributes
          ]
        end

        def permitted_checkout_attributes
          permitted_attributes.checkout_attributes + [
            bill_address_attributes: permitted_address_attributes,
            ship_address_attributes: permitted_address_attributes,
            payments_attributes: permitted_payment_attributes,
            shipments_attributes: permitted_shipment_attributes
          ]
        end

        def permitted_order_attributes
          permitted_checkout_attributes + [
            line_items_attributes: permitted_line_item_attributes
          ]
        end

        def permitted_product_attributes
          permitted_attributes.product_attributes + [
            product_properties_attributes: permitted_product_properties_attributes
          ]
        end

        def permitted_user_attributes
          permitted_attributes.user_attributes + [
            bill_address_attributes: permitted_address_attributes,
            ship_address_attributes: permitted_address_attributes
          ]
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
solidus_core-2.5.2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.5.1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.5.0 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.5.0.rc1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.5.0.beta2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.5.0.beta1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.4.2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.3.1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.4.1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.2.2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.1.1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.0.3 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-1.4.2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-1.3.2 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.4.0 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.4.0.rc1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.4.0.beta1 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.3.0 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.3.0.rc3 lib/spree/core/controller_helpers/strong_parameters.rb
solidus_core-2.3.0.rc2 lib/spree/core/controller_helpers/strong_parameters.rb