Sha256: d95afce756b7cc521848fa17c302dfe1f442b8364ec5d0a836619cc917da5f3a

Contents?: true

Size: 730 Bytes

Versions: 20

Compression:

Stored size: 730 Bytes

Contents

# Log of participant viewings and listenings of media slides
class MediaAccessEvent < ActiveRecord::Base
  belongs_to :participant,
             foreign_key: :participant_id
  belongs_to :slide,
             class_name: "BitCore::Slide",
             foreign_key: :bit_core_slide_id
  validates :media_type, inclusion: { in: ["audio", "video"] }
  validates :media_link,
            :participant,
            :slide,
            presence: :true

  delegate :title, to: :slide, prefix: true

  def task_release_day
    module_id = slide.slideshow.content_provider.bit_core_content_module_id

    Task.where(
      bit_core_content_module_id: module_id,
      group_id: participant.active_group.id
    ).first.release_day
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
think_feel_do_engine-3.14.0 app/models/media_access_event.rb
think_feel_do_engine-3.13.1 app/models/media_access_event.rb
think_feel_do_engine-3.13.0 app/models/media_access_event.rb
think_feel_do_engine-3.12.9 app/models/media_access_event.rb
think_feel_do_engine-3.12.8 app/models/media_access_event.rb
think_feel_do_engine-3.12.7 app/models/media_access_event.rb
think_feel_do_engine-3.12.6 app/models/media_access_event.rb
think_feel_do_engine-3.12.5 app/models/media_access_event.rb
think_feel_do_engine-3.12.4 app/models/media_access_event.rb
think_feel_do_engine-3.12.3 app/models/media_access_event.rb
think_feel_do_engine-3.12.2 app/models/media_access_event.rb
think_feel_do_engine-3.12.1 app/models/media_access_event.rb
think_feel_do_engine-3.12.0 app/models/media_access_event.rb
think_feel_do_engine-3.11.3 app/models/media_access_event.rb
think_feel_do_engine-3.11.0 app/models/media_access_event.rb
think_feel_do_engine-3.10.10 app/models/media_access_event.rb
think_feel_do_engine-3.10.9 app/models/media_access_event.rb
think_feel_do_engine-3.10.8 app/models/media_access_event.rb
think_feel_do_engine-3.10.7 app/models/media_access_event.rb
think_feel_do_engine-3.10.6 app/models/media_access_event.rb