Sha256: 147761501a66160b22f51cf909e4f70dbfeb615f6d7097f39ebcb1f0b1f3abc1
Contents?: true
Size: 761 Bytes
Versions: 16
Compression:
Stored size: 761 Bytes
Contents
class Address < ActiveRecord::Base self.table_name = 'core_addresses' belongs_to :addressable, :polymorphic => true attr_accessor :name biggs :postal_address, :recipient => :name, :country => :country_code, :street => Proc.new {|address| "#{address.line1} #{address.line2}" } #------------------------------------------------------------------------------ def to_s(name_to_use = '') self.name = name_to_use postal_address.strip end #------------------------------------------------------------------------------ def to_html(name_to_use = '') # self.to_s(name_to_use).gsub("\n", "<br/>".html_safe) self.to_s(name_to_use).split(/\n/).xss_aware_join('<br>'.html_safe) end end
Version data entries
16 entries across 16 versions & 1 rubygems