Sha256: edb4bd305e16338682c9a596dacae173bbdc82636845d17780db1c3178a31694

Contents?: true

Size: 667 Bytes

Versions: 5

Compression:

Stored size: 667 Bytes

Contents

module Pageflow
  class Account < ActiveRecord::Base
    include FeatureTarget

    has_many :users, dependent: :restrict_with_exception
    has_many :entries, dependent: :restrict_with_exception
    has_many :folders, dependent: :destroy

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pageflow-0.11.4 app/models/pageflow/account.rb
pageflow-0.11.3 app/models/pageflow/account.rb
pageflow-0.11.2 app/models/pageflow/account.rb
pageflow-0.11.1 app/models/pageflow/account.rb
pageflow-0.11.0 app/models/pageflow/account.rb