File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -1372,8 +1372,6 @@ def report_note(opts)
1372
1372
=end
1373
1373
ntype = opts . delete ( :type ) || opts . delete ( :ntype ) || ( raise RuntimeError , "A note :type or :ntype is required" )
1374
1374
data = opts [ :data ]
1375
- method = nil
1376
- args = [ ]
1377
1375
note = nil
1378
1376
1379
1377
conditions = { :ntype => ntype }
@@ -1382,15 +1380,7 @@ def report_note(opts)
1382
1380
1383
1381
case mode
1384
1382
when :unique
1385
- notes = wspace . notes . where ( conditions )
1386
-
1387
- # Only one note of this type should exist, make a new one if it
1388
- # isn't there. If it is, grab it and overwrite its data.
1389
- if notes . empty?
1390
- note = wspace . notes . new ( conditions )
1391
- else
1392
- note = notes [ 0 ]
1393
- end
1383
+ note = wspace . notes . where ( conditions ) . first_or_initialize
1394
1384
note . data = data
1395
1385
when :unique_data
1396
1386
notes = wspace . notes . where ( conditions )
You can’t perform that action at this time.
0 commit comments