aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/simple_interface.rb
diff options
context:
space:
mode:
authorZog2018-03-05 16:10:57 +0100
committerZog2018-03-05 16:10:57 +0100
commit445e22852334f8e70aca47f33f971b7a8944a74c (patch)
treeac39f041999bca6d0c315a22750c4de09418094e /app/models/simple_interface.rb
parent2b1a8cdc047cd80108ac4c5ef1fd2a64d77ab750 (diff)
downloadchouette-core-445e22852334f8e70aca47f33f971b7a8944a74c.tar.bz2
Refs #6068; :fire: useless method
and fix specs
Diffstat (limited to 'app/models/simple_interface.rb')
-rw-r--r--app/models/simple_interface.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/models/simple_interface.rb b/app/models/simple_interface.rb
index 5a1c3dca8..489419482 100644
--- a/app/models/simple_interface.rb
+++ b/app/models/simple_interface.rb
@@ -77,8 +77,9 @@ class SimpleInterface < ActiveRecord::Base
protected
def push_in_journal data
- line = @current_line + 1
+ line = (@current_line || 0) + 1
line += 1 if configuration.headers
+ @errors ||= []
self.journal.push data.update(line: line, row: @current_row)
if data[:kind] == :error || data[:kind] == :warning
@errors.push data
@@ -178,10 +179,10 @@ class SimpleInterface < ActiveRecord::Base
end
def on_relation relation_name
- @scope ||= []
- @scope.push relation_name
+ @current_scope ||= []
+ @current_scope.push relation_name
yield
- @scope.pop
+ @current_scope.pop
end
def duplicate
@@ -228,8 +229,8 @@ class SimpleInterface < ActiveRecord::Base
end
def add_column name, opts={}
- @scope ||= []
- @columns.push Column.new({name: name.to_s, scope: @scope.dup}.update(opts))
+ @current_scope ||= []
+ @columns.push Column.new({name: name.to_s, scope: @current_scope.dup}.update(opts))
end
def add_value attribute, value