module JamRuby
  # Video analog to JamRuby::RecordedTrack
  class RecordedVideo < ActiveRecord::Base   
    belongs_to :user, :class_name => "JamRuby::User", :inverse_of => :recorded_videos
    belongs_to :recording, :class_name => "JamRuby::Recording", :inverse_of => :recorded_videos

    validates :client_video_source_id, :presence => true

    def upload_sign(content_md5)
      
    end

    def self.create_from_video_source(video_source, recording)
      recorded_video_source = self.new
      recorded_video_source.recording = recording
      recorded_video_source.client_video_source_id = video_source.client_video_source_id
      recorded_video_source.user = video_source.connection.user
      recorded_video_source.save      
      recorded_video_source
    end
  end
end
