Skip to content

Commit

Permalink
Fix move
Browse files Browse the repository at this point in the history
  • Loading branch information
gordienko committed Sep 5, 2022
1 parent deb5b7b commit c6b4758
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -34,3 +34,4 @@
!/app/assets/builds/.keep

/node_modules
.idea
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -156,6 +156,8 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.0-x86_64-darwin)
racc (~> 1.4)
orm_adapter (0.5.0)
Expand Down Expand Up @@ -256,6 +258,7 @@ GEM
zeitwerk (2.5.3)

PLATFORMS
arm64-darwin-21
x86_64-darwin-20

DEPENDENCIES
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/menuitems_controller.rb
Expand Up @@ -33,9 +33,9 @@ def update
def move
@menuitem = Menuitem.find(params[:id])
if params[:ancestry] == 'undefined'
@menuitem.update_columns(ancestry: nil)
@menuitem.update(parent_id: nil)
else
@menuitem.update_columns(ancestry: params[:ancestry])
@menuitem.update(parent_id: params[:ancestry])
end
@menuitem.insert_at(params[:position].to_i)
head :ok
Expand Down

0 comments on commit c6b4758

Please sign in to comment.