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.62 app/models/comee/core/transport_availability.rb
comee_core-0.3.61 app/models/comee/core/transport_availability.rb
comee_core-0.3.60 app/models/comee/core/transport_availability.rb
comee_core-0.3.59 app/models/comee/core/transport_availability.rb
comee_core-0.3.58 app/models/comee/core/transport_availability.rb
comee_core-0.3.57 app/models/comee/core/transport_availability.rb
comee_core-0.3.56 app/models/comee/core/transport_availability.rb
comee_core-0.3.55 app/models/comee/core/transport_availability.rb
comee_core-0.3.54 app/models/comee/core/transport_availability.rb
comee_core-0.3.53 app/models/comee/core/transport_availability.rb
comee_core-0.3.51 app/models/comee/core/transport_availability.rb
comee_core-0.3.50 app/models/comee/core/transport_availability.rb
comee_core-0.3.49 app/models/comee/core/transport_availability.rb
comee_core-0.3.48 app/models/comee/core/transport_availability.rb
comee_core-0.3.47 app/models/comee/core/transport_availability.rb
comee_core-0.3.46 app/models/comee/core/transport_availability.rb
comee_core-0.3.45 app/models/comee/core/transport_availability.rb
comee_core-0.3.44 app/models/comee/core/transport_availability.rb
comee_core-0.3.43 app/models/comee/core/transport_availability.rb
comee_core-0.3.42 app/models/comee/core/transport_availability.rb