Sha256: 08c786855eb01959514100d91857629e5f12c511f0319e75cfc0cfb69bdcfd19

Contents?: true

Size: 754 Bytes

Versions: 10

Compression:

Stored size: 754 Bytes

Contents

module Pageflow
  class Theming < ApplicationRecord
    belongs_to :account

    has_many :entries

    scope :with_home_url, -> { where.not(home_url: '') }
    scope :for_request, ->(request) { Pageflow.config.theming_request_scope.call(all, request) }

    validates :account, :presence => true

    def cname_domain
      cname.split('.').pop(2).join('.')
    end

    def name
      I18n.t('pageflow.admin.themings.name',
             account_name: account.name,
             theme_name: 'default')
    end

    # @deprecated Depending on what you need this for, consider
    # scoping your code to an entry type or look at a specific entry's
    # theme name.
    def theme_name
      account.first_paged_entry_template.theme_name
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pageflow-15.7.1 app/models/pageflow/theming.rb
pageflow-15.7.0 app/models/pageflow/theming.rb
pageflow-15.6.1 app/models/pageflow/theming.rb
pageflow-15.6.0 app/models/pageflow/theming.rb
pageflow-15.5.0 app/models/pageflow/theming.rb
pageflow-15.4.0 app/models/pageflow/theming.rb
pageflow-15.3.0 app/models/pageflow/theming.rb
pageflow-15.2.2 app/models/pageflow/theming.rb
pageflow-15.2.1 app/models/pageflow/theming.rb
pageflow-15.2.0 app/models/pageflow/theming.rb