Module: ModelExt::Restaurants::ImenuPro
- Included in:
- Restaurant
- Defined in:
- lib/model_ext/restaurants/imenu_pro.rb
Overview
Responsible for IMenu Pro integration for Restaurant model
Instance Method Summary collapse
Instance Method Details
#imenu_pro_link ⇒ Object
6 7 8 9 |
# File 'lib/model_ext/restaurants/imenu_pro.rb', line 6 def note = ::GenericNote.fetch_by_parent_id_and_parent_type id, self.class.to_s note.try(:imenu_pro_links) || [] end |
#imenu_pro_link=(links) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/model_ext/restaurants/imenu_pro.rb', line 11 def (links) note = ::GenericNote.find_or_initialize_by(parent_id: id, parent_type: self.class.to_s) note. = links.strip.split(',').map(&:strip) unless note.save errors.add(:base, note.errors..to_sentence) end note end |