mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 01:11:23 +00:00
12 lines
269 B
Ruby
12 lines
269 B
Ruby
class CustomUrl < ActiveRecord::Base
|
|
belongs_to :article
|
|
attr_accessible :name
|
|
|
|
validates :name,
|
|
length: {in: 2..10},
|
|
uniqueness: true,
|
|
format: /\A[a-z]+([\-])?[a-z]+\Z/
|
|
|
|
validates :article_id,
|
|
presence: true
|
|
end
|