Sha256: 089b3f7c254dafe93a71ef6ec821ab3ab7e6b2a2a62701943af983a0407a0bf7

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

module BitPlayer
  # Modeled after the presenter pattern. Ties data layer to view layer.
  class ContentProvider < ActiveRecord::Base
    include BitPlayer::ContentProviders::ViewProvider

    belongs_to :content_module,
               class_name: "BitPlayer::ContentModule",
               foreign_key: :bit_player_content_module_id,
               inverse_of: :content_providers
    belongs_to :source_content, polymorphic: true

    validates :content_module, :position, presence: true
    validates :position, numericality: { greater_than_or_equal_to: 1 }

    delegate :context, to: :content_module, prefix: false

    def exists?(position)
      false
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bit_player-0.2.5 app/models/bit_player/content_provider.rb
bit_player-0.2.3 app/models/bit_player/content_provider.rb
bit_player-0.2.2 app/models/bit_player/content_provider.rb
bit_player-0.2.1 app/models/bit_player/content_provider.rb
bit_player-0.2.0 app/models/bit_player/content_provider.rb
bit_player-0.1.4 app/models/bit_player/content_provider.rb