Merge branch 'bug/MSP-10724/fix-import-failure' into staging/electro-release MSP-10724 #land
commit
08cd2690f9
|
@ -1372,8 +1372,6 @@ class DBManager
|
||||||
=end
|
=end
|
||||||
ntype = opts.delete(:type) || opts.delete(:ntype) || (raise RuntimeError, "A note :type or :ntype is required")
|
ntype = opts.delete(:type) || opts.delete(:ntype) || (raise RuntimeError, "A note :type or :ntype is required")
|
||||||
data = opts[:data]
|
data = opts[:data]
|
||||||
method = nil
|
|
||||||
args = []
|
|
||||||
note = nil
|
note = nil
|
||||||
|
|
||||||
conditions = { :ntype => ntype }
|
conditions = { :ntype => ntype }
|
||||||
|
@ -1382,15 +1380,7 @@ class DBManager
|
||||||
|
|
||||||
case mode
|
case mode
|
||||||
when :unique
|
when :unique
|
||||||
notes = wspace.notes.where(conditions)
|
note = wspace.notes.where(conditions).first_or_initialize
|
||||||
|
|
||||||
# Only one note of this type should exist, make a new one if it
|
|
||||||
# isn't there. If it is, grab it and overwrite its data.
|
|
||||||
if notes.empty?
|
|
||||||
note = wspace.notes.new(conditions)
|
|
||||||
else
|
|
||||||
note = notes[0]
|
|
||||||
end
|
|
||||||
note.data = data
|
note.data = data
|
||||||
when :unique_data
|
when :unique_data
|
||||||
notes = wspace.notes.where(conditions)
|
notes = wspace.notes.where(conditions)
|
||||||
|
|
Loading…
Reference in New Issue