chore: rubocop
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
This commit is contained in:
parent
f6fb804bbe
commit
fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions
|
|
@ -1,7 +1,7 @@
|
|||
module FoodsoftLinks
|
||||
class Engine < ::Rails::Engine
|
||||
def navigation(primary, context)
|
||||
primary.item :links, I18n.t('navigation.links'), '#', if: Proc.new { visble_links(context).any? } do |subnav|
|
||||
primary.item :links, I18n.t('navigation.links'), '#', if: proc { visble_links(context).any? } do |subnav|
|
||||
visble_links(context).each do |link|
|
||||
subnav.item link.id, link.name, context.link_path(link)
|
||||
end
|
||||
|
|
@ -11,15 +11,15 @@ module FoodsoftLinks
|
|||
primary.items.insert(i, primary.items.delete_at(-1))
|
||||
end
|
||||
|
||||
unless primary[:admin].nil?
|
||||
sub_nav = primary[:admin].sub_navigation
|
||||
sub_nav.items <<
|
||||
SimpleNavigation::Item.new(primary, :links, I18n.t('navigation.admin.links'), context.admin_links_path)
|
||||
# move to right before config item
|
||||
if i = sub_nav.items.index(sub_nav[:config])
|
||||
sub_nav.items.insert(i, sub_nav.items.delete_at(-1))
|
||||
end
|
||||
end
|
||||
return if primary[:admin].nil?
|
||||
|
||||
sub_nav = primary[:admin].sub_navigation
|
||||
sub_nav.items <<
|
||||
SimpleNavigation::Item.new(primary, :links, I18n.t('navigation.admin.links'), context.admin_links_path)
|
||||
# move to right before config item
|
||||
return unless i = sub_nav.items.index(sub_nav[:config])
|
||||
|
||||
sub_nav.items.insert(i, sub_nav.items.delete_at(-1))
|
||||
end
|
||||
|
||||
def visble_links(context)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module FoodsoftLinks
|
||||
VERSION = "0.0.1"
|
||||
VERSION = '0.0.1'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue