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_option, #set_options

Instance Method Details

#childrenObject

return all children taxonomy sample: sub categories of a category


32
33
34
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 32

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


37
38
39
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 37

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)

42
43
44
# File 'app/models/camaleon_cms/term_taxonomy.rb', line 42

def skip_slug_validation?
  false
end