diff options
| author | Marc Florisson | 2013-07-08 17:12:18 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2013-07-08 17:12:18 +0200 | 
| commit | 0cad1a2a6cc092b8bf4e2d479f247d87b1cd409d (patch) | |
| tree | 15a1cebe90e70c3f4906c82e2b9025556c47f30d /app | |
| parent | 267c336f437257f293c8d04d17d716df2885dae6 (diff) | |
| download | chouette-core-0cad1a2a6cc092b8bf4e2d479f247d87b1cd409d.tar.bz2 | |
fix Kml Export : correct use of Referential
Diffstat (limited to 'app')
| -rw-r--r-- | app/exporters/chouette/kml/exporter.rb | 7 | ||||
| -rw-r--r-- | app/models/export.rb | 2 | ||||
| -rw-r--r-- | app/models/kml_export.rb | 2 | 
3 files changed, 7 insertions, 4 deletions
| diff --git a/app/exporters/chouette/kml/exporter.rb b/app/exporters/chouette/kml/exporter.rb index 29fcac879..9a3cf5eef 100644 --- a/app/exporters/chouette/kml/exporter.rb +++ b/app/exporters/chouette/kml/exporter.rb @@ -1,7 +1,7 @@  class Chouette::Kml::Exporter  -  def initialize() - +  def initialize(referential) +    @referential = referential    end    def lines(object, ids) @@ -17,8 +17,9 @@ class Chouette::Kml::Exporter    end    def export(zip_file_path, options = {})     -      begin        +      @referential.switch +        FileUtils.rm(zip_file_path) if File.exists? zip_file_path                Dir.mktmpdir{ |temp_dir| diff --git a/app/models/export.rb b/app/models/export.rb index 566b0c435..eee7b1943 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -72,6 +72,8 @@ class Export < ActiveRecord::Base      FileUtils.mkdir_p root      begin +      # delayed job may repeat call +      ExportLogMessage.where(:export_id => self.id).delete_all         log_messages.create :key => :started        exporter.export file, export_options diff --git a/app/models/kml_export.rb b/app/models/kml_export.rb index 83218a09f..418c2ccc1 100644 --- a/app/models/kml_export.rb +++ b/app/models/kml_export.rb @@ -5,7 +5,7 @@ class KmlExport < Export    end    def exporter -    exporter ||= ::Chouette::Kml::Exporter.new() +    exporter ||= ::Chouette::Kml::Exporter.new(referential)    end  end | 
