Module: Alchemy::Page::PageCells::ClassMethods

Defined in:
app/models/alchemy/page/page_cells.rb

Instance Method Summary collapse

Instance Method Details

#copy_cells(source, target) ⇒ Array

Copy page cells

Parameters:

Returns:

  • (Array)


17
18
19
20
21
22
23
# File 'app/models/alchemy/page/page_cells.rb', line 17

def copy_cells(source, target)
  new_cells = []
  source.cells.each do |cell|
    new_cells << Cell.create(name: cell.name, page_id: target.id)
  end
  new_cells
end