13 lines
218 B
Ruby
13 lines
218 B
Ruby
class AnnonceCat < ActiveRecord::Base
|
|
acts_as_tree
|
|
has_many :annonces
|
|
def top_categories
|
|
AnnonceCat.where(:parent_id => nil).all
|
|
end
|
|
|
|
before_validation do
|
|
self.slug = self.name.to_slug
|
|
|
|
end
|
|
end
|