Sha256: 7e3b2fab4c775a7cf34851c6d21d39b63adf4b3f5519f4899759c93341af1234

Contents?: true

Size: 598 Bytes

Versions: 4

Compression:

Stored size: 598 Bytes

Contents

Rails.application.config.to_prepare do
  Spree::PermittedAttributes.product_attributes << :prototype_id
  Spree::Backend::Config.configure do |config|
    product_tab = config.menu_items.detect { |menu_item|
      menu_item.label == :products
    }
    if product_tab.respond_to?(:children)
      product_tab.children << Spree::BackendConfiguration::MenuItem.new(
        condition: -> { can?(:admin, Spree::Prototype) },
        url: :admin_prototypes_path,
        label: :prototypes,
        match_path: '/prototypes'
      )
    else
      product_tab.sections << :prototypes
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_prototypes-1.6.0 config/initializers/spree.rb
solidus_prototypes-1.5.1 config/initializers/spree.rb
solidus_prototypes-1.5.0 config/initializers/spree.rb
solidus_prototypes-1.4.0 config/initializers/spree.rb