Sha256: f04cc6320f09c4cf24f0756b591fc465a2d3e02673b2ed679a0c697837e7efcc
Contents?: true
Size: 661 Bytes
Versions: 1
Compression:
Stored size: 661 Bytes
Contents
module BitPlayer class ContentModule < ActiveRecord::Base has_many :content_providers, class_name: 'BitPlayer::ContentProvider', foreign_key: :bit_player_content_module_id, inverse_of: :content_module validates :title, :context, :position, presence: true validates_numericality_of :position, greater_than_or_equal_to: 1 validates_uniqueness_of :position, scope: :context def provider(position) content_providers.where(position: position).first || BitPlayer::ContentProviders::Null.new(self) end def provider_exists?(position) content_providers.exists?(position: position) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bit_player-0.1.0 | app/models/bit_player/content_module.rb |