Class: GtfsEngine::DataSet

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/gtfs_engine/data_set.rb

Instance Method Summary collapse

Instance Method Details

#calendars_for_date(date_string) ⇒ Object



41
42
43
44
45
# File 'app/models/gtfs_engine/data_set.rb', line 41

def calendars_for_date(date_string)
  Rails.cache.fetch "data[#{id}]_calendars[#{date_string}]" do
    Calendar.from_date_string(date_string).where(data_set_id: id).to_a
  end
end

#detailsHash

Returns a hash of each record type and the number of records in this data set.

Returns:

  • (Hash)

    a hash of each record type and the number of records in this data set



37
38
39
# File 'app/models/gtfs_engine/data_set.rb', line 37

def details
  Rails.cache.fetch("gtfs_data_set_details_#{id}") { create_details }
end