mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +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
|