You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
501 B
12 lines
501 B
5 years ago
|
class ExaminationBanks::SaveExamForm
|
||
|
include ActiveModel::Model
|
||
|
|
||
|
attr_accessor :discipline_id, :sub_discipline_id, :difficulty, :name, :duration, :tag_discipline_id
|
||
|
|
||
|
validates :discipline_id, presence: true
|
||
|
validates :sub_discipline_id, presence: true
|
||
|
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
|
||
|
validates :name, presence: true, length: { maximum: 60 }
|
||
|
validates :duration, numericality: { only_integer: true, greater_than: 0 }
|
||
|
|
||
|
end
|