Class: DcManual
- Inherits:
-
Object
- Object
- DcManual
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/dc_manual.rb
Overview
DcManual model definition. DcManual defines common data for manual document.
Instance Method Summary collapse
-
#choices4_all_as_tree(all = false) ⇒ Object
Returns menu data suitable for choices in tree_select DRGCMS field.
-
#do_before_save ⇒ Object
Update befoer save.
Instance Method Details
#choices4_all_as_tree(all = false) ⇒ Object
Returns menu data suitable for choices in tree_select DRGCMS field
67 68 69 |
# File 'app/models/dc_manual.rb', line 67 def choices4_all_as_tree(all=false) all ? DcManual.() : DcManual.(self) end |
#do_before_save ⇒ Object
Update befoer save
55 56 57 58 59 60 61 62 |
# File 'app/models/dc_manual.rb', line 55 def do_before_save # update link if self.link.blank? self.link = DcManual.clear_link( self.title.downcase.strip ) end # Prepare menu_data for caching menu. Save as tab delimited self. = DcManual.(self).inject('') {|result, element| result << element.join("\t") + "\n"} end |