1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/app/models/category.rb
2018-02-16 11:10:13 -05:00

13 lines
233 B
Ruby

class Category < ActiveRecord::Base
has_and_belongs_to_many :photos
validates :name, presence: true, uniqueness: true
validates :slug, presence: true, uniqueness: true
slug :slug, from: :name
def to_s
name
end
end