Sha256: 02f798b43b4440592fc1d9b57ad424174338f48afe1cf686f35d30789ab46d0d
Contents?: true
Size: 419 Bytes
Versions: 12
Compression:
Stored size: 419 Bytes
Contents
class PhoneNumber < ActiveRecord::Base belongs_to :vcard belongs_to :object, :polymorphic => true validates_presence_of :number def label case phone_number_type when 'phone' "Tel:" when 'fax' "Fax:" when 'mobile' "Mob:" when 'email' "Mail:" else "" end end def to_s(separator = " ") return [label, number].compact.join(separator) end end
Version data entries
12 entries across 12 versions & 1 rubygems