Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Insert menu item after "stock" if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Nov 21, 2017
1 parent 09abf09 commit 17d7593
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/solidus_stock_transfers/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class Engine < Rails::Engine

initializer "add_stock_transfer_menu_item" do
Spree::Backend::Config.configure do |config|
config.menu_items << config.class::MenuItem.new(
# Insert after "stock", if that exists
idx = (config.menu_items.index { |item| item.label == :stock } || -2) + 1
config.menu_items.insert idx, config.class::MenuItem.new(
[:stock_transfers],
'exchange',
url: :admin_stock_transfers_path
Expand Down

0 comments on commit 17d7593

Please sign in to comment.