Class: GtfsEngine::DataSet
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- GtfsEngine::DataSet
- Defined in:
- app/models/gtfs_engine/data_set.rb
Instance Method Summary collapse
- #calendars_for_date(date_string) ⇒ Object
-
#details ⇒ Hash
A hash of each record type and the number of records in this data set.
Instance Method Details
#calendars_for_date(date_string) ⇒ Object
29 30 31 32 33 |
# File 'app/models/gtfs_engine/data_set.rb', line 29 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 |
#details ⇒ Hash
Returns a hash of each record type and the number of records in this data set.
25 26 27 |
# File 'app/models/gtfs_engine/data_set.rb', line 25 def details Rails.cache.fetch("gtfs_data_set_details_#{id}") { create_details } end |