2011-04-04 21:44:42 +00:00
|
|
|
class Track < ActiveRecord::Base
|
|
|
|
set_table_name 'musicbrainz.bh_track'
|
2011-04-05 22:58:11 +00:00
|
|
|
belongs_to :release
|
2011-04-04 21:44:42 +00:00
|
|
|
|
2011-04-05 22:58:11 +00:00
|
|
|
def convertLength
|
|
|
|
(length /= 1000).round!
|
2011-04-04 21:44:42 +00:00
|
|
|
end
|
|
|
|
|
2011-04-05 22:58:11 +00:00
|
|
|
def clearName
|
2011-04-04 21:44:42 +00:00
|
|
|
name.gsub('&', 'and').gsub(/[^a-z0-9]/, '').downcase
|
|
|
|
end
|
|
|
|
end
|