Class: CamaleonCms::TermTaxonomy

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
CustomFieldsRead, Metas
Defined in:
app/models/camaleon_cms/term_taxonomy.rb

Instance Method Summary collapse

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_multiple_options, #set_option

Instance Method Details

#childrenObject

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 = ?", self.id)
end

#in_nav_menu_itemsObject

return all menu items in which this taxonomy was assigned



45
46
47
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 45

def in_nav_menu_items
  CamaleonCms::NavMenuItem.where(url: self.id, kind: self.taxonomy)
end

#skip_slug_validation?Boolean

permit to skip slug validations for children models, like menu items

Returns:

  • (Boolean)


50
51
52
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 50

def skip_slug_validation?
  false
end