summaryrefslogtreecommitdiff
path: root/app/models/ringtone.rb
blob: 36053c0c6d34e4e175e0cccaf5a41d2a974a3425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Ringtone < ActiveRecord::Base
  attr_accessible :audio, :bellcore_id
  
  mount_uploader :audio, AudioUploader
  validates_presence_of :audio, :if => Proc.new{ |ringtone| ringtone.bellcore_id.blank? }
  validates_presence_of :ringtoneable_type
  validates_presence_of :ringtoneable_id
  validates_presence_of :ringtoneable
  
  belongs_to :ringtoneable, :polymorphic => true

  def to_s
    self.bellcore_id.to_s
  end
end