Added track files
This commit is contained in:
		
							parent
							
								
									4adff3cc96
								
							
						
					
					
						commit
						20ee424e7f
					
				
							
								
								
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Gemfile
									
									
									
									
									
								
							@ -1,5 +1,6 @@
 | 
			
		||||
source 'http://rubygems.org'
 | 
			
		||||
 | 
			
		||||
gem 'rack', '1.3.3'
 | 
			
		||||
gem 'rails', '3.1.0'
 | 
			
		||||
gem 'unicorn'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -72,7 +72,7 @@ GEM
 | 
			
		||||
    nokogiri (1.5.0)
 | 
			
		||||
    pg (0.11.0)
 | 
			
		||||
    polyglot (0.3.2)
 | 
			
		||||
    rack (1.3.4)
 | 
			
		||||
    rack (1.3.3)
 | 
			
		||||
    rack-cache (1.0.3)
 | 
			
		||||
      rack (>= 0.4)
 | 
			
		||||
    rack-mount (0.8.3)
 | 
			
		||||
@ -135,6 +135,7 @@ DEPENDENCIES
 | 
			
		||||
  mysql2 (= 0.3.7)
 | 
			
		||||
  nokogiri
 | 
			
		||||
  pg
 | 
			
		||||
  rack (= 1.3.3)
 | 
			
		||||
  rails (= 3.1.0)
 | 
			
		||||
  sass
 | 
			
		||||
  therubyracer
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								app/models/track_file.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								app/models/track_file.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
class TrackFile < ActiveRecord::Base
 | 
			
		||||
end
 | 
			
		||||
@ -0,0 +1,5 @@
 | 
			
		||||
class AddAvailableFlagToTracks < ActiveRecord::Migration
 | 
			
		||||
  def change
 | 
			
		||||
    add_column :tracks, :available, :boolean
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										12
									
								
								db/migrate/20111012064322_create_track_files.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								db/migrate/20111012064322_create_track_files.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
class CreateTrackFiles < ActiveRecord::Migration
 | 
			
		||||
  def change
 | 
			
		||||
    create_table :track_files do |t|
 | 
			
		||||
      t.integer :track_id
 | 
			
		||||
      t.integer :owner_id
 | 
			
		||||
      t.integer :audio_id
 | 
			
		||||
      t.integer :rating
 | 
			
		||||
 | 
			
		||||
      t.timestamps
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										12
									
								
								db/schema.rb
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								db/schema.rb
									
									
									
									
									
								
							@ -11,7 +11,7 @@
 | 
			
		||||
#
 | 
			
		||||
# It's strongly recommended to check this file into your version control system.
 | 
			
		||||
 | 
			
		||||
ActiveRecord::Schema.define(:version => 20110926031740) do
 | 
			
		||||
ActiveRecord::Schema.define(:version => 20111012064322) do
 | 
			
		||||
 | 
			
		||||
  create_table "album_formats", :force => true do |t|
 | 
			
		||||
    t.integer "album_id"
 | 
			
		||||
@ -190,6 +190,15 @@ ActiveRecord::Schema.define(:version => 20110926031740) do
 | 
			
		||||
  add_index "track_artists", ["main"], :name => "index_track_artists_on_main"
 | 
			
		||||
  add_index "track_artists", ["track_id"], :name => "index_track_artists_on_track_id"
 | 
			
		||||
 | 
			
		||||
  create_table "track_files", :force => true do |t|
 | 
			
		||||
    t.integer  "track_id"
 | 
			
		||||
    t.integer  "owner_id"
 | 
			
		||||
    t.integer  "audio_id"
 | 
			
		||||
    t.integer  "rating"
 | 
			
		||||
    t.datetime "created_at"
 | 
			
		||||
    t.datetime "updated_at"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  create_table "tracks", :force => true do |t|
 | 
			
		||||
    t.string   "name"
 | 
			
		||||
    t.integer  "album_id"
 | 
			
		||||
@ -202,6 +211,7 @@ ActiveRecord::Schema.define(:version => 20110926031740) do
 | 
			
		||||
    t.integer  "length"
 | 
			
		||||
    t.string   "country"
 | 
			
		||||
    t.string   "mbid"
 | 
			
		||||
    t.boolean  "available"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  add_index "tracks", ["album_id"], :name => "index_tracks_on_album_id"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								test/fixtures/track_files.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								test/fixtures/track_files.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
 | 
			
		||||
 | 
			
		||||
one:
 | 
			
		||||
  track_id: 1
 | 
			
		||||
  owner_id: 1
 | 
			
		||||
  audio_id: 1
 | 
			
		||||
  rating: 1
 | 
			
		||||
 | 
			
		||||
two:
 | 
			
		||||
  track_id: 1
 | 
			
		||||
  owner_id: 1
 | 
			
		||||
  audio_id: 1
 | 
			
		||||
  rating: 1
 | 
			
		||||
							
								
								
									
										7
									
								
								test/unit/track_file_test.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								test/unit/track_file_test.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
require 'test_helper'
 | 
			
		||||
 | 
			
		||||
class TrackFileTest < ActiveSupport::TestCase
 | 
			
		||||
  # test "the truth" do
 | 
			
		||||
  #   assert true
 | 
			
		||||
  # end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user