Class: CamaleonCms::TermTaxonomy
- Inherits:
-
CamaleonRecord
- Object
- ActiveRecord::Base
- CamaleonRecord
- CamaleonCms::TermTaxonomy
- 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 collapse
- TRANSLATION_TAG_HIDE_MAP =
{ '<!--' => '!--', '-->' => '--!' }.freeze
- TRANSLATION_TAG_HIDE_REGEX =
Regexp.new(TRANSLATION_TAG_HIDE_MAP.keys.map { |x| Regexp.escape(x) }.join('|')).freeze
- TRANSLATION_TAG_RESTORE_MAP =
{ '--!' => '-->', '!--' => '<!--' }.freeze
- TRANSLATION_TAG_RESTORE_REGEX =
Regexp.new(TRANSLATION_TAG_RESTORE_MAP.keys.map { |x| Regexp.escape(x) }.join('|')).freeze
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 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
12 13 14 15 16 17 18 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 12 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
60 61 62 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 60 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
65 66 67 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 65 def CamaleonCms::NavMenuItem.where(url: id, kind: taxonomy) end |
#skip_slug_validation? ⇒ Boolean
permit to skip slug validations for children models, like menu items
70 71 72 |
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 70 def skip_slug_validation? false end |