diff options
| author | Luc Donnet | 2015-05-18 12:41:13 +0200 | 
|---|---|---|
| committer | Luc Donnet | 2015-05-18 12:41:13 +0200 | 
| commit | 3a997856387b2d50178c29c5bd728b133f2dcd84 (patch) | |
| tree | ff0af160b83933dc42aafc593cfa4f31befd0a0b /app/models/import.rb | |
| parent | 1ee52cce4c325a58368f3e28e8070f7b3bb4f4f2 (diff) | |
| download | chouette-core-3a997856387b2d50178c29c5bd728b133f2dcd84.tar.bz2 | |
Fix bugs Refs #0035525 #0035531 #0035523
Diffstat (limited to 'app/models/import.rb')
| -rw-r--r-- | app/models/import.rb | 24 | 
1 files changed, 6 insertions, 18 deletions
diff --git a/app/models/import.rb b/app/models/import.rb index 733795bd8..2a3ee18db 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -3,21 +3,6 @@ require 'open-uri'  class Import    include JobConcern -  # def compliance_check_validation_report? -  # end -   -  # def compliance_check_validation_report -  #   Rails.cache.fetch("#{cache_key}/validation_report", expires_in: cache_expiration) do -  #     report_path = links["validation_report"] -  #     if report_path -  #       response = Ievkit.get(report_path) -  #       ComplianceCheckResult.new(response) -  #     else -  #       raise Ievkit::IevError("Impossible to access report path link for validation of import") -  #     end -  #   end -  # end -    def report?      links["action_report"].present?    end @@ -42,7 +27,8 @@ class Import      Rails.cache.fetch("#{cache_key}/validation_params", expires_in: cache_expiration) do        rule_parameter_set_path = links["validation_params"]        if rule_parameter_set_path -        ::JSON.load( open(rule_parameter_set_path).read ) +        response = Ievkit.get(rule_parameter_set_path) +        rule_parameter_set = RuleParameterSet.new(:name => "", :import => self).tap { |rps| rps.parameters = response.validation }        else          nil        end @@ -53,11 +39,13 @@ class Import      links["validation_report"].present?    end -  def compliance_check +  def compliance_check_validation_report +    puts "compliance_check_validation_report"      Rails.cache.fetch("#{cache_key}/validation_report", expires_in: cache_expiration) do        compliance_check_path = links["validation_report"]        if compliance_check_path -        ::JSON.load( open(compliance_check_path).read ) +        response = Ievkit.get(compliance_check_path) +        ComplianceCheckResult.new(response)        else          nil        end  | 
