ensl.org/app/models/custom_url.rb

13 lines
269 B
Ruby
Raw Normal View History

class CustomUrl < ActiveRecord::Base
2017-11-09 17:25:52 +00:00
belongs_to :article
attr_accessible :name
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