Sha256: 4ea737282ba31918fa1ae4ade195e19b0c5d50f1ec50d9a5dcfea056b34aad5a

Contents?: true

Size: 950 Bytes

Versions: 56

Compression:

Stored size: 950 Bytes

Contents

module Pageflow
  class Account < ApplicationRecord
    include FeatureTarget
    include SerializationBlacklist

    has_many :entries, dependent: :restrict_with_exception
    has_many :folders, dependent: :destroy
    has_many :memberships, as: :entity, dependent: :restrict_with_exception
    has_many :users, through: :memberships, source: :user, class_name: '::User'
    has_many :entry_memberships, through: :entries, source: :memberships

    has_many :themings, dependent: :destroy
    belongs_to :default_theming, :class_name => 'Theming'

    validates :default_theming, :presence => true

    accepts_nested_attributes_for :default_theming, :update_only => true

    scope :with_landing_page, -> { where.not(:landing_page_name => '') }

    def build_default_theming(*args)
      super.tap do |theming|
        theming.account = self
      end
    end

    def blacklist_for_serialization
      [:features_configuration]
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/models/pageflow/account.rb
pageflow-15.1.2 app/models/pageflow/account.rb
pageflow-15.1.1 app/models/pageflow/account.rb
pageflow-15.1.0 app/models/pageflow/account.rb
pageflow-15.1.0.rc0 app/models/pageflow/account.rb
pageflow-15.1.0.beta6 app/models/pageflow/account.rb
pageflow-15.1.0.beta5 app/models/pageflow/account.rb
pageflow-15.1.0.beta4 app/models/pageflow/account.rb
pageflow-15.1.0.beta3 app/models/pageflow/account.rb
pageflow-15.1.0.beta2 app/models/pageflow/account.rb
pageflow-15.1.0.beta1 app/models/pageflow/account.rb
pageflow-15.0.2 app/models/pageflow/account.rb
pageflow-15.0.1 app/models/pageflow/account.rb
pageflow-15.0.0 app/models/pageflow/account.rb
pageflow-14.5.1 app/models/pageflow/account.rb
pageflow-14.5.0 app/models/pageflow/account.rb
pageflow-15.0.0.rc2 app/models/pageflow/account.rb
pageflow-15.0.0.rc1 app/models/pageflow/account.rb
pageflow-15.0.0.beta4 app/models/pageflow/account.rb
pageflow-15.0.0.beta3 app/models/pageflow/account.rb