Sha256: d4b0bce55fe96b03133104f471f2fe353e69255ba50ac07be72127da9152f4a3

Contents?: true

Size: 395 Bytes

Versions: 1

Compression:

Stored size: 395 Bytes

Contents

module Georgia
  class Slide < ActiveRecord::Base

    include Concerns::Contentable

    # acts_as_list scope: :page
    belongs_to :revision, foreign_key: :page_id
    validates :page_id, presence: true

    scope :ordered, -> { order(:position) }

    # Returns a page if revision is a `current_revision` for a Georgia::Page
    def page
      @page ||= revision.try(:page)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia-0.8.0 app/models/georgia/slide.rb