1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/app/models/category.rb
2013-06-05 08:31:17 +01:00

8 lines
181 B
Ruby

class Category < ActiveRecord::Base
has_and_belongs_to_many :photos
validates_presence_of :name, :slug
validates_uniqueness_of :name, :slug
has_slug :slug, from: :name
end