Class: DynamicMenu
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- DynamicMenu
- Defined in:
- app/models/dynamic_menu.rb
Instance Method Summary collapse
Instance Method Details
#check_callbacks? ⇒ Boolean
25 26 27 |
# File 'app/models/dynamic_menu.rb', line 25 def check_callbacks? !check_callbacks.to_s.strip.empty? end |
#check_callbacks_enum ⇒ Object
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 |
#validate ⇒ Object
7 8 9 |
# File 'app/models/dynamic_menu.rb', line 7 def validate self. = 0 if self..to_i == 0 end |