Class: CategoryDb::Model::Category

Inherits:
ActiveRecord::Base show all
Defined in:
lib/tagutils/models/category.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/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 (remove! add depreciated api call) ?? why? why not??



34
# File 'lib/tagutils/models/category.rb', line 34

def title()       name;              end

#title=(value) ⇒ Object



35
# File 'lib/tagutils/models/category.rb', line 35

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