2015-01-29 01:17:20 +00:00
|
|
|
module JamRuby
|
|
|
|
|
class BackingTrack < ActiveRecord::Base
|
|
|
|
|
|
|
|
|
|
self.table_name = "backing_tracks"
|
|
|
|
|
self.primary_key = 'id'
|
|
|
|
|
|
2016-07-17 15:16:27 +00:00
|
|
|
default_scope { order('created_at ASC') }
|
2015-01-29 01:17:20 +00:00
|
|
|
|
|
|
|
|
belongs_to :connection, :class_name => "JamRuby::Connection", :inverse_of => :tracks, :foreign_key => 'connection_id'
|
|
|
|
|
validates :connection, presence: true
|
|
|
|
|
validates :client_track_id, presence: true
|
2015-01-31 21:20:48 +00:00
|
|
|
validates :filename, presence: true
|
2015-01-29 01:17:20 +00:00
|
|
|
|
|
|
|
|
def user
|
|
|
|
|
self.connection.user
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|