Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wattsworth
/
lumen-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bfebc471
authored
Jul 07, 2023
by
John Donnal
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
improved nilm destroy logic for removing large nodes
parent
f8e904fc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
app/controllers/nilms_controller.rb
app/controllers/nilms_controller.rb
View file @
bfebc471
...
...
@@ -67,6 +67,13 @@ class NilmsController < ApplicationController
# DELETE /nilms/1.json
def
destroy
@service
=
StubService
.
new
@db
=
@nilm
.
db
DbStream
.
where
(
db_id:
@db
.
id
).
each
do
|
stream
|
DbElement
.
where
(
db_stream_id:
stream
.
id
).
delete_all
end
DbStream
.
where
(
db_id:
@db
.
id
).
delete_all
DbFolder
.
where
(
db_id:
@db
.
id
).
delete_all
EventStream
.
where
(
db_id:
@db
.
id
).
delete_all
@nilm
.
destroy
@service
.
set_notice
(
'removed nilm'
)
render
'helpers/empty_response'
,
status: :ok
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment