Sha256: c6aa47a0668c30f9cb7d378fb5428e3ae368b5ed62b22249250d4a8c904f5cf1

Contents?: true

Size: 509 Bytes

Versions: 166

Compression:

Stored size: 509 Bytes

Contents

module Comee
  module Core
    class TransportAvailability < ApplicationRecord
      before_save :compute_weekday

      has_many :time_slots

      validates :availability_date, presence: true, uniqueness: true

      def compute_weekday
        self.weekday = availability_date.strftime("%A")
        self.weekday_short = availability_date.strftime("%a")
      end

      def self.ransackable_attributes(_auth_object = nil)
        %w[id availability_date weekday weekday_short]
      end
    end
  end
end

Version data entries

166 entries across 166 versions & 1 rubygems

Version Path
comee_core-0.3.21 app/models/comee/core/transport_availability.rb
comee_core-0.3.20 app/models/comee/core/transport_availability.rb
comee_core-0.3.19 app/models/comee/core/transport_availability.rb
comee_core-0.3.18 app/models/comee/core/transport_availability.rb
comee_core-0.3.17 app/models/comee/core/transport_availability.rb
comee_core-0.3.16 app/models/comee/core/transport_availability.rb
comee_core-0.3.15 app/models/comee/core/transport_availability.rb
comee_core-0.3.14 app/models/comee/core/transport_availability.rb
comee_core-0.3.13 app/models/comee/core/transport_availability.rb
comee_core-0.3.12 app/models/comee/core/transport_availability.rb
comee_core-0.3.11 app/models/comee/core/transport_availability.rb
comee_core-0.3.10 app/models/comee/core/transport_availability.rb
comee_core-0.3.9 app/models/comee/core/transport_availability.rb
comee_core-0.3.8 app/models/comee/core/transport_availability.rb
comee_core-0.3.7 app/models/comee/core/transport_availability.rb
comee_core-0.3.6 app/models/comee/core/transport_availability.rb
comee_core-0.3.5 app/models/comee/core/transport_availability.rb
comee_core-0.3.4 app/models/comee/core/transport_availability.rb
comee_core-0.3.3 app/models/comee/core/transport_availability.rb
comee_core-0.3.2 app/models/comee/core/transport_availability.rb