Class: Alchemy::Upgrader::FourPointTwo

Inherits:
Alchemy::Upgrader show all
Defined in:
lib/alchemy/upgrader/four_point_two.rb

Class Method Summary collapse

Methods inherited from Alchemy::Upgrader

copy_new_config_file

Methods included from Shell

#add_todo, #desc, #display_todos, #log, silence!, silenced?, #todo, #todos, verbose!

Class Method Details

.alchemy_4_2_todosObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/alchemy/upgrader/four_point_two.rb', line 36

def alchemy_4_2_todos
  notice = <<-NOTE.strip_heredoc
    âš ī¸  Element's "picture_gallery" feature removed
    ----------------------------------------------

    The `picture_gallery` feature of elements was removed and has been replaced by nestable elements.

    The automatic updater that just ran updated your `config/alchemy/elements.yml`. A backup was made.
    Nevertheless, you should have a look into it and double check the changes.

    We created nested elements for each gallery picture we found in your database.

    We also updated your element view partials so they have hints about how to render the child elements.

    🚨 PLEASE LOOK INTO YOUR ELEMENT VIEW PARTIALS AND FOLLOW THE INSTRUCTIONS!


    âš ī¸ī¸  Cells replaced by fixed nestable elements
    --------------------------------------------

    The Cells feature has been replaced by fixed nestable elements.

    The automatic updater that just ran updated your `config/alchemy/elements.yml`.
    Nevertheless, you should have a look into it and double check the changes.

    We defined new fixed elements for each cell former defined in `cells.yml`
    and put its `elements` into the `nestable_elements` collection of the new elements definition.

    We also updated your element view partials so they render the child elements.

    Please review and fix markup, if necessary.

    🚨 PLEASE DOUBLE CHECK YOUR ELEMENT PARTIALS AND ADJUST ACCORDINGLY!

    As always `git diff` is your friend.


    â„šī¸  Element views use element partial name as local variable
    -----------------------------------------------------------

    The local `element` variable in your element views has been replaced by a variable named after the partial.
    A "article" element has a "_article_view.html.erb" partial and therefore a `article_view` local variable now.

    The former `element` variable is still present, though.

  NOTE
  todo notice, 'Alchemy v4.2 TODO'
end

.convert_cellsObject



21
22
23
24
# File 'lib/alchemy/upgrader/four_point_two.rb', line 21

def convert_cells
  desc 'Convert cells config to fixed nestable elements.'
  Alchemy::Upgrader::Tasks::CellsUpgrader.new.convert_cells
end

.convert_picture_galleriesObject



11
12
13
14
# File 'lib/alchemy/upgrader/four_point_two.rb', line 11

def convert_picture_galleries
  desc 'Convert `picture_gallery` element definitions to `nestable_elements`.'
  Alchemy::Upgrader::Tasks::PictureGalleryUpgrader.new.convert_picture_galleries
end

.migrate_cellsObject



26
27
28
29
# File 'lib/alchemy/upgrader/four_point_two.rb', line 26

def migrate_cells
  desc 'Migrate existing cells to fixed nestable elements.'
  Alchemy::Upgrader::Tasks::CellsMigration.new.migrate_cells
end

.migrate_picture_galleriesObject



16
17
18
19
# File 'lib/alchemy/upgrader/four_point_two.rb', line 16

def migrate_picture_galleries
  desc 'Migrate existing gallery elements to `nestable_elements`.'
  Alchemy::Upgrader::Tasks::PictureGalleryMigration.new.migrate_picture_galleries
end

.update_element_views_variable_nameObject



31
32
33
34
# File 'lib/alchemy/upgrader/four_point_two.rb', line 31

def update_element_views_variable_name
  desc 'Update element views to use element partial name variable.'
  Alchemy::Upgrader::Tasks::ElementPartialNameVariableUpdater.new.update_element_views
end