Sha256: 2afea33a0d7579a98624d93d31a9622fde95a69f834957a7c12afd9af5d8373f

Contents?: true

Size: 703 Bytes

Versions: 7

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

# This module is responsible for managing what attributes can be updated
# through the api. It also overrides Spree::Permitted attributes to allow the
# solidus api to accept nested params for subscription models as well
module SolidusSubscriptions
  module PermittedAttributes
    class << self
      def subscription_line_item_attributes
        [SolidusSubscriptions.configuration.subscription_line_item_attributes]
      end

      def subscription_attributes
        SolidusSubscriptions.configuration.subscription_attributes | [
          line_items_attributes: (subscription_line_item_attributes | [:id] - [:subscribable_id]),
        ]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_subscriptions-2.0.2 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-2.0.1 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-2.0.0 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-1.1.0 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-1.0.1 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-1.0.0 lib/solidus_subscriptions/permitted_attributes.rb
solidus_subscriptions-1.0.0.rc1 lib/solidus_subscriptions/permitted_attributes.rb