aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMichel Etienne2012-06-19 14:32:24 +0200
committerMichel Etienne2012-06-19 14:32:24 +0200
commitd142fee1e270ded464e3fb482d5a075b8f640a6c (patch)
tree2099f94ea674b75382e978a79d0febd395bbf0f6 /app/models
parent5e858faea9eeff60b2f0d7f524ec2f80d1221acf (diff)
downloadchouette-core-d142fee1e270ded464e3fb482d5a075b8f640a6c.tar.bz2
effective export with reports
Diffstat (limited to 'app/models')
-rw-r--r--app/models/export.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/export.rb b/app/models/export.rb
index a202e77ef..4fd6ff2f1 100644
--- a/app/models/export.rb
+++ b/app/models/export.rb
@@ -21,6 +21,10 @@ class Export < ActiveRecord::Base
end
end
+ def exporter
+ exporter ||= ::Chouette::Exporter.new(referential.slug)
+ end
+
def options
read_attribute(:options) || write_attribute(:options, {})
end
@@ -42,7 +46,7 @@ class Export < ActiveRecord::Base
end
def export_options
- { :export_id => self.id, :output_file => file }
+ { :export_id => self.id }
end
before_validation :define_default_attributes, :on => :create
@@ -61,8 +65,7 @@ class Export < ActiveRecord::Base
begin
log_messages.create :key => :started
- # TODO
- # Make real export here
+ exporter.export file, export_options
update_attribute :status, "completed"
rescue => e