Skip to content

Commit

Permalink
Merge pull request #1623 from mamhoff/patch-2
Browse files Browse the repository at this point in the history
Cell Migrator: Maintain element order in fixed elements
  • Loading branch information
tvdeyen authored Sep 24, 2019
2 parents d653666 + 4ef122b commit 44a5a5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/alchemy/upgrader/tasks/cells_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def migrate_cell!(cell)
# bust element definitions insta cache
Alchemy::Element.instance_variable_set('@definitions', nil)
fixed_element = Alchemy::Element.find_or_initialize_by(fixed: true, name: cell.name, page: cell.page)
elements = Alchemy::Element.where(cell_id: cell.id)
elements = Alchemy::Element.where(cell_id: cell.id).order(position: :asc)

if fixed_element.new_record?
fixed_element.nested_elements = elements
Expand Down

0 comments on commit 44a5a5f

Please sign in to comment.