aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/gtfs_export.rb
blob: 6ee83098fa716696110428202b65f29ed841c053 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class GtfsExport < Export

  validates_presence_of :time_zone
  option :time_zone
  option :object_id_prefix
  
  after_initialize :init_params
  
  def references_types
    [ Chouette::Line, Chouette::Network, Chouette::Company, Chouette::StopArea ]
  end

  def init_params
    if time_zone.nil?
      self.time_zone = "Paris"
    end
  end
  
  def export_options
    opts = super.merge(:format => :gtfs, :time_zone => ActiveSupport::TimeZone.find_tzinfo(time_zone).name)
    if object_id_prefix.present?
      opts = opts.merge(:object_id_prefix => object_id_prefix)
    end
    puts opts.inspect
    opts
  end

end