Class: DynamicMenu

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/dynamic_menu.rb

Instance Method Summary collapse

Instance Method Details

#check_callbacks?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/dynamic_menu.rb', line 25

def check_callbacks?
  !check_callbacks.to_s.strip.empty?
end

#check_callbacks_enumObject



17
18
19
20
21
22
23
# File 'app/models/dynamic_menu.rb', line 17

def check_callbacks_enum
  Enumerator.new do |yielder|
    self.check_callbacks.to_s.strip.split(/\s*,\s*/).each do |str|
      yielder << str.to_s.strip.to_sym unless str.empty?
    end
  end
end

#title!Object



11
12
13
14
15
# File 'app/models/dynamic_menu.rb', line 11

def title!
  title_str = title
  return "[#{_("no title")}]" if title_str.to_s.strip.empty?
  return title_str
end

#validateObject



7
8
9
# File 'app/models/dynamic_menu.rb', line 7

def validate
  self.dynamic_menu_id = 0 if self.dynamic_menu_id.to_i == 0
end