Sha256: 859185ab9b40d57ec7f239fc8460c25b9826ba7aca7651b143a7fd656972bd88

Contents?: true

Size: 518 Bytes

Versions: 39

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Ingredients
    # A link to a page
    #
    # Assign Alchemy::Page to this ingredient
    #
    class Page < Alchemy::Ingredient
      related_object_alias :page, class_name: "Alchemy::Page"

      # The first 30 characters of page name
      #
      # Used by the Element#preview_text method.
      #
      # @param [Integer] max_length (30)
      #
      def preview_text(max_length = 30)
        page&.name.to_s[0..max_length - 1]
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.9 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.8 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.7 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.6 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.5 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.14 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.4 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.13 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.3 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.2 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.1 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.1.0 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.12 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.11 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.10 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.9 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.8 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.7 app/models/alchemy/ingredients/page.rb
alchemy_cms-6.0.6 app/models/alchemy/ingredients/page.rb