Sha256: 31fc4495d1597ba5b5d6b67fe238e1501a2dea3ab215b150c450d9096a046066

Contents?: true

Size: 718 Bytes

Versions: 32

Compression:

Stored size: 718 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(group)
    module_id = slide.slideshow.content_provider.bit_core_content_module_id

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.6 app/models/media_access_event.rb
think_feel_do_engine-3.19.5 app/models/media_access_event.rb
think_feel_do_engine-3.19.4 app/models/media_access_event.rb
think_feel_do_engine-3.19.3 app/models/media_access_event.rb
think_feel_do_engine-3.19.2 app/models/media_access_event.rb
think_feel_do_engine-3.19.1 app/models/media_access_event.rb
think_feel_do_engine-3.19.0 app/models/media_access_event.rb
think_feel_do_engine-3.18.0 app/models/media_access_event.rb
think_feel_do_engine-3.17.2 app/models/media_access_event.rb
think_feel_do_engine-3.17.1 app/models/media_access_event.rb
think_feel_do_engine-3.17.0 app/models/media_access_event.rb
think_feel_do_engine-3.16.3 app/models/media_access_event.rb
think_feel_do_engine-3.16.2 app/models/media_access_event.rb
think_feel_do_engine-3.16.1 app/models/media_access_event.rb
think_feel_do_engine-3.15.7 app/models/media_access_event.rb
think_feel_do_engine-3.16.0 app/models/media_access_event.rb
think_feel_do_engine-3.15.6 app/models/media_access_event.rb
think_feel_do_engine-3.15.5 app/models/media_access_event.rb
think_feel_do_engine-3.15.4 app/models/media_access_event.rb
think_feel_do_engine-3.15.3 app/models/media_access_event.rb