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.2.81 app/models/comee/core/transport_availability.rb
comee_core-0.2.80 app/models/comee/core/transport_availability.rb
comee_core-0.2.78 app/models/comee/core/transport_availability.rb
comee_core-0.2.77 app/models/comee/core/transport_availability.rb
comee_core-0.2.76 app/models/comee/core/transport_availability.rb
comee_core-0.2.75 app/models/comee/core/transport_availability.rb
comee_core-0.2.70 app/models/comee/core/transport_availability.rb
comee_core-0.2.69 app/models/comee/core/transport_availability.rb
comee_core-0.2.68 app/models/comee/core/transport_availability.rb
comee_core-0.2.67 app/models/comee/core/transport_availability.rb
comee_core-0.2.66 app/models/comee/core/transport_availability.rb
comee_core-0.2.65 app/models/comee/core/transport_availability.rb
comee_core-0.2.64 app/models/comee/core/transport_availability.rb
comee_core-0.2.63 app/models/comee/core/transport_availability.rb
comee_core-0.2.62 app/models/comee/core/transport_availability.rb
comee_core-0.2.61 app/models/comee/core/transport_availability.rb
comee_core-0.2.60 app/models/comee/core/transport_availability.rb
comee_core-0.2.59 app/models/comee/core/transport_availability.rb
comee_core-0.2.58 app/models/comee/core/transport_availability.rb
comee_core-0.2.57 app/models/comee/core/transport_availability.rb