lib/faalis/generators/concerns/menu.rb in faalis-0.19.0 vs lib/faalis/generators/concerns/menu.rb in faalis-0.20.0

- old
+ new

@@ -3,25 +3,16 @@ module Concerns module Menu def self.included(base) # Provide menu items which should be in sidebar. format: menu1:url,menu2:url - base.class_option :menu, :type => :string, :default => "", :desc => "Provide menu items which should be in sidebar. format: menu1:url,menu2:url" + #base.class_option :menu, :type => :string, :default => "", :desc => "Provide menu items which should be in sidebar. format: menu1:url,menu2:url" end private - def parse_menu(menu) - regex = /([^:{}]+){1}\:([^:\{\}]+)(?:{(.*)})?/i - model = nil - if menu =~ regex - title = $1 - url = $2 - model = $3 - return title, url, model - else - Raise Exception.new "Menu items format should be like 'name:url{model}'. Model part is optional" - end + def has_menu? + resource_data.include? "menu" end end end end