Class: CategoryDb::Model::Category

Inherits:
ActiveRecord::Base show all
Defined in:
lib/tagutils/categories/models/category.rb,
lib/tagutils/categories/models/category_comp.rb

Instance Method Summary collapse

Methods included from TagDb::ClassMacros

#has_many_tags

Methods included from ClassMacros

#has_many_categories

Instance Method Details

#on_before_saveObject



25
26
27
28
# File 'lib/tagutils/categories/models/category.rb', line 25

def on_before_save
  # replace space with dash e.g. north america becomes north_america and so on
  self.slug = key.gsub( ' ', '_' )
end

#titleObject

alias for name (depreciated api calls)



11
# File 'lib/tagutils/categories/models/category_comp.rb', line 11

def title()       name;              end

#title=(value) ⇒ Object



12
# File 'lib/tagutils/categories/models/category_comp.rb', line 12

def title=(value) self.name = value; end