Sha256: d8c5c28e791c06669d24987e6e3d09d5a4e83bfb7c3a6f8d95769757f893b544
Contents?: true
Size: 593 Bytes
Versions: 136
Compression:
Stored size: 593 Bytes
Contents
module Comee module Core class TimeSlot < ApplicationRecord belongs_to :transport_availability validates :from, :to, presence: true validate :validate_time_range def validate_time_range return unless from && to errors.add(:base, "From must be before to.") if from >= to end def self.ransackable_attributes(_auth_object = nil) %w[from id to transport_availability_id created_at updated_at] end def self.ransackable_associations(_auth_object = nil) ["transport_availability"] end end end end
Version data entries
136 entries across 136 versions & 1 rubygems