No idea why this didn't fail before

MSP-10724
bug/bundler_fix
Trevor Rosen 2014-07-17 10:15:22 -05:00
parent ff017f83f7
commit e789d5350b
No known key found for this signature in database
GPG Key ID: 255ADB7A642D3928
1 changed files with 1 additions and 11 deletions

View File

@ -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)