aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/import.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-05-07 14:40:37 +0200
committerLuc Donnet2015-05-07 14:40:37 +0200
commit73abd85f6181e33fe0b2fe31a5c46f2fbc44eb8a (patch)
treef284e3994937c1e58a68625dc347a0ad7d557945 /app/models/import.rb
parent46c9cd634a1b2f36df872bd0acbca25884673810 (diff)
downloadchouette-core-73abd85f6181e33fe0b2fe31a5c46f2fbc44eb8a.tar.bz2
Fix import
Diffstat (limited to 'app/models/import.rb')
-rw-r--r--app/models/import.rb46
1 files changed, 1 insertions, 45 deletions
diff --git a/app/models/import.rb b/app/models/import.rb
index 903da32aa..54795361e 100644
--- a/app/models/import.rb
+++ b/app/models/import.rb
@@ -1,23 +1,7 @@
require 'open-uri'
class Import
- extend ActiveModel::Naming
- extend ActiveModel::Translation
- include ActiveModel::Model
-
- attr_reader :datas
-
- def initialize( response )
- @datas = response
- end
-
- def links
- {}.tap do |links|
- datas.links.each do |link|
- links[link["rel"]] = link["href"]
- end
- end
- end
+ include JobConcern
def compliance_check_validation_report
report_path = links["validation_report"]
@@ -82,40 +66,12 @@ class Import
File.extname(filename).gsub(".", "") if filename
end
- def id
- datas.id
- end
-
- def status
- datas.status.downcase
- end
-
def format
datas.type
end
- def referential_name
- datas.referential
- end
-
- def name
- datas.action_parameters.name
- end
-
- def user_name
- datas.action_parameters.user_name
- end
-
def no_save
datas.action_parameters.no_save
end
- def created_at
- Time.at(datas.created.to_i / 1000) if datas.created
- end
-
- def updated_at
- Time.at(datas.updated.to_i / 1000) if datas.updated
- end
-
end