ensl.org/app/models/custom_url.rb

13 lines
278 B
Ruby
Raw Normal View History

class CustomUrl < ActiveRecord::Base
2017-11-09 17:25:52 +00:00
belongs_to :article
2020-03-17 01:03:02 +00:00
# FIXME: attr_accessible :name
2017-11-09 17:25:52 +00:00
validates :name,
length: {in: 2..10},
uniqueness: true,
2017-11-12 00:26:00 +00:00
format: /\A[a-z]+([\-])?[a-z]+\Z/
validates :article_id,
presence: true
2017-11-09 17:25:52 +00:00
end