Sha256: 5a6deb7f90de6d278857360ba9938cdefb833907e8a5dc8f0f09812084667107

Contents?: true

Size: 458 Bytes

Versions: 29

Compression:

Stored size: 458 Bytes

Contents

module Cms
  module PageAssociationMethods
    def root
      first :conditions => {:root => true}
    end
  end

  module ContextAssociation
    def ContextAssociation.extended(other)
      other.has_many :pages, :class_name => 'Cms::Page', :dependent => :destroy, :foreign_key => :context_id, :extend => PageAssociationMethods
      other.has_many :assets, :class_name => 'Cms::Asset', :dependent => :destroy, :foreign_key => :context_id
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
liquid_cms-0.3.0.3 lib/liquid_cms/context_association.rb
liquid_cms-0.2.0.5 lib/liquid_cms/context_association.rb
liquid_cms-0.2.0.4 lib/liquid_cms/context_association.rb
liquid_cms-0.3.0.2 lib/liquid_cms/context_association.rb
liquid_cms-0.2.0.3 lib/liquid_cms/context_association.rb
liquid_cms-0.2.0.2 lib/liquid_cms/context_association.rb
liquid_cms-0.3.0.1 lib/liquid_cms/context_association.rb
liquid_cms-0.3.0 lib/liquid_cms/context_association.rb
liquid_cms-0.2.0 lib/liquid_cms/context_association.rb