MongoDB config & TrackData model

This commit is contained in:
magnolia-fan
2011-04-07 06:50:02 +04:00
parent a9b4a46c59
commit 3c96c151bd
8 changed files with 72 additions and 18879 deletions
+4 -4
View File
@@ -2,11 +2,11 @@ class Track < ActiveRecord::Base
set_table_name 'musicbrainz.bh_track'
belongs_to :release
def convertLength
(length /= 1000).round!
end
def clearName
name.gsub('&', 'and').gsub(/[^a-z0-9]/, '').downcase
end
def files
TrackData(:id => id)
end
end
+10
View File
@@ -0,0 +1,10 @@
class TrackData
include Mongoid::Document
store_in :track_data
key :id, Integer
key :artist, String
key :title, String
key :length, Integer
key :files, Array
end