Sha256: 69cdf8a87d4e08707c4deda48a79d39ba4cdd211db579a3b49dee3efb0c4a147

Contents?: true

Size: 1.92 KB

Versions: 15

Compression:

Stored size: 1.92 KB

Contents

# frozen_string_literal: true

require_relative 'tasks/element_views_updater'

module Alchemy
  class Upgrader::FourPointFour < Upgrader
    class << self
      def rename_element_views
        desc "Remove '_view' suffix from element views."
        Alchemy::Upgrader::Tasks::ElementViewsUpdater.new.rename_element_views
      end

      def update_local_variable
        desc 'Update element views local variable to element name.'
        Alchemy::Upgrader::Tasks::ElementViewsUpdater.new.update_local_variable
      end

      def alchemy_4_4_todos
        notice = <<-NOTE.strip_heredoc

          ℹ️  Element editor partials are deprecated
          -----------------------------------------

          The element editor partials are not needed anymore. They still work, but in order to
          prepare the Alchemy 5 upgrade your should consider removing them now.

          In order to update check if you have any messages in your editor partials and move them
          to either a `warning` or `message` in your element definition.

          Also check if you pass any values to EssenceSelects `select_values`. Move static values
          to the `settings` of your content definition and either use EssencePage for referencing
          pages or create a custom essence for other dynamic values.


          ℹ️  The `_view` suffix of Element view partials is deprecated
          -----------------------------------------------------------

          The element view partials do not need the `_view` suffix anymore. Your files have been
          renamed.

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

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
alchemy_cms-4.6.7 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.6 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.5 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.5.1 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.4.5 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.4 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.3 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.2 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.1 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.6.0 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.5.0 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.4.4 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.4.3 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.4.2 lib/alchemy/upgrader/four_point_four.rb
alchemy_cms-4.4.1 lib/alchemy/upgrader/four_point_four.rb