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

Version Path
dm_core-4.2.3.10 app/models/address.rb
dm_core-4.2.3.9 app/models/address.rb
dm_core-4.2.3.8 app/models/address.rb
dm_core-4.2.3.7 app/models/address.rb
dm_core-4.2.3.6 app/models/address.rb
dm_core-4.2.3.5 app/models/address.rb
dm_core-4.2.3.4 app/models/address.rb
dm_core-4.2.3.3 app/models/address.rb
dm_core-4.2.3.2 app/models/address.rb
dm_core-4.2.3.1 app/models/address.rb
dm_core-4.2.3 app/models/address.rb
dm_core-4.2.2.3 app/models/address.rb
dm_core-4.2.2.2 app/models/address.rb
dm_core-4.2.2.1 app/models/address.rb
dm_core-4.2.2 app/models/address.rb
dm_core-4.2.1.5 app/models/address.rb