Class: CamaleonCms::TermTaxonomy
- Inherits:
-
CamaleonRecord
- Object
- ActiveRecord::Base
- CamaleonRecord
- CamaleonCms::TermTaxonomy
- Extended by:
- NormalizeAttrs
- Includes:
- CustomFieldsRead, Metas
- Defined in:
- app/models/camaleon_cms/term_taxonomy.rb
Direct Known Subclasses
Category, NavMenu, NavMenuItem, Plugin, PostTag, PostType, Site, Theme, UserRole, Widget::Main, Widget::Sidebar
Constant Summary
Constants inherited from CamaleonRecord
CamaleonRecord::TRANSLATION_TAG_HIDE_MAP, CamaleonRecord::TRANSLATION_TAG_HIDE_REGEX, CamaleonRecord::TRANSLATION_TAG_RESTORE_MAP, CamaleonRecord::TRANSLATION_TAG_RESTORE_REGEX
Class Method Summary collapse
Instance Method Summary collapse
-
#children ⇒ Object
return all children taxonomy sample: sub categories of a category.
-
#in_nav_menu_items ⇒ Object
return all menu items in which this taxonomy was assigned.
-
#skip_slug_validation? ⇒ Boolean
permit to skip slug validations for children models, like menu items.
Methods included from NormalizeAttrs
Methods included from CustomFieldsRead
#add_custom_field_group, #add_custom_field_to_default_group, #get_field_groups, #get_field_object, #get_field_value, #get_field_values, #get_field_values_hash, #get_fields_grouped, #get_fields_object, #get_user_field_groups, #save_field_value, #set_field_value, #set_field_values, #update_field_value
Methods included from Metas
#delete_meta, #delete_option, #fix_save_metas_options_no_changed, #get_meta, #get_option, #options, #save_metas_options, #save_metas_options_skip, #set_meta, #set_metas, #set_option, #set_options
Methods inherited from CamaleonRecord
#cama_build_cache_key, #cama_fetch_cache, #cama_get_cache, #cama_remove_cache, #cama_set_cache
Class Method Details
.inherited(subclass) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 8 def self.inherited(subclass) super subclass.class_eval do include CamaleonCms::CommonRelationships end end |
Instance Method Details
#children ⇒ Object
return all children taxonomy sample: sub categories of a category
40 41 42 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 40 def children CamaleonCms::TermTaxonomy.where("#{CamaleonCms::TermTaxonomy.table_name}.parent_id = ?", id) end |
#in_nav_menu_items ⇒ Object
return all menu items in which this taxonomy was assigned
45 46 47 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 45 def CamaleonCms::NavMenuItem.where(url: id, kind: taxonomy) end |
#skip_slug_validation? ⇒ Boolean
permit to skip slug validations for children models, like menu items
50 51 52 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 50 def skip_slug_validation? false end |