Sha256: dff51a94f4f589da2c5e77e8a8194b6da85b6556911202b9e5196ac5d465827a

Contents?: true

Size: 1.27 KB

Versions: 102

Compression:

Stored size: 1.27 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_payment_attributes
          permitted_attributes.payment_attributes + [
            source_attributes: permitted_source_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 + [
            :store_id,
            product_properties_attributes: permitted_product_properties_attributes
          ]
        end
      end
    end
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
spree_core-3.7.10 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.3 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.9 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.2 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.8 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.1 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.7 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.0 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.0.rc3 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.6 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.5 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.0.rc2 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.0.rc1 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-4.0.0.beta lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.4 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.3 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.2 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.1 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.0 lib/spree/core/controller_helpers/strong_parameters.rb
spree_core-3.7.0.rc3 lib/spree/core/controller_helpers/strong_parameters.rb