diff options
| author | Zog | 2018-04-24 14:00:17 +0200 | 
|---|---|---|
| committer | Zog | 2018-05-07 15:03:07 +0200 | 
| commit | 42ac1fa61ea79fe612bcd98f2b38bad5b6f24421 (patch) | |
| tree | 71e1023bde0de16489df1df798f962b8b4d85219 /app/controllers | |
| parent | 3750a1da0650b692046d7422537a310ba5c5bfd6 (diff) | |
| download | chouette-core-42ac1fa61ea79fe612bcd98f2b38bad5b6f24421.tar.bz2 | |
Rework imports to use Resources and make the a little more verbose
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/import_resources_controller.rb | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/app/controllers/import_resources_controller.rb b/app/controllers/import_resources_controller.rb index 1535fd171..46f8f0337 100644 --- a/app/controllers/import_resources_controller.rb +++ b/app/controllers/import_resources_controller.rb @@ -24,6 +24,15 @@ class ImportResourcesController < ChouetteController      @import_resources ||= parent.resources    end +  def resource +    @import ||= Import::Base.find params[:import_id] +    @import_resource ||= begin +      import_resource = Import::Resource.find params[:id] +      raise ActiveRecord::RecordNotFound unless import_resource.import == @import +      import_resource +    end +  end +    private    def decorate_import_resources(import_resources) | 
