Sha256: b8f12a7f5678cd0a93ef39405671f2f387c6d027add0b4655c9e4d873e1f3e79
Contents?: true
Size: 378 Bytes
Versions: 9
Compression:
Stored size: 378 Bytes
Contents
module Logistics module Core class InterCityRoute < Route validates :from_id, :to_id, presence: true, allow_blank: false validates :from_id, uniqueness: {scope: [:from_id, :to_id]} validate :check_from_id_and_to_id def check_from_id_and_to_id errors.add(:from_id, "can't be the same as to.") if from_id == to_id end end end end
Version data entries
9 entries across 9 versions & 1 rubygems