ensl.org/app/models/custom_url.rb
2020-03-17 03:03:02 +02:00

12 lines
278 B
Ruby

class CustomUrl < ActiveRecord::Base
belongs_to :article
# FIXME: attr_accessible :name
validates :name,
length: {in: 2..10},
uniqueness: true,
format: /\A[a-z]+([\-])?[a-z]+\Z/
validates :article_id,
presence: true
end