Class: Alchemy::Upgrader::Tasks::NestableElementsMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/alchemy/upgrader/tasks/nestable_elements_migration.rb

Instance Method Summary collapse

Instance Method Details

#migrate_existing_elementsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/alchemy/upgrader/tasks/nestable_elements_migration.rb', line 3

def migrate_existing_elements
  elements_with_nestable_elements = Alchemy::Element.all.select do |e|
    e.definition['nestable_elements']
  end

  if elements_with_nestable_elements.present?
    elements_with_nestable_elements.each do |el|
      migrate_element(el)
    end
  else
    puts "No elements with `nestable_elements` found. Skip"
  end
end