Sha256: bb49049fbdbc7ef6f4c4ee0b3c3cffc8e20ad402c6f58348c63fb39e702e88cc

Contents?: true

Size: 335 Bytes

Versions: 68

Compression:

Stored size: 335 Bytes

Contents

module Dorsale
  class Address < ActiveRecord::Base
    belongs_to :addressable, polymorphic: true, inverse_of: :address

    validates :addressable, presence: true

    def one_line
      zip_city = [zip, city].select(&:present?).join(' ')
      [street, street_bis, zip_city, country].select(&:present?).join(', ')
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
dorsale-3.0.3 app/models/dorsale/address.rb
dorsale-3.0.2 app/models/dorsale/address.rb
dorsale-3.0.1 app/models/dorsale/address.rb
dorsale-3.0.0 app/models/dorsale/address.rb
dorsale-2.7.3 app/models/dorsale/address.rb
dorsale-2.7.2 app/models/dorsale/address.rb
dorsale-2.7.1 app/models/dorsale/address.rb
dorsale-2.7.0 app/models/dorsale/address.rb
dorsale-2.6.8 app/models/dorsale/address.rb
dorsale-2.6.7 app/models/dorsale/address.rb
dorsale-2.6.6 app/models/dorsale/address.rb
dorsale-2.6.5 app/models/dorsale/address.rb
dorsale-2.6.4 app/models/dorsale/address.rb
dorsale-2.6.3 app/models/dorsale/address.rb
dorsale-2.6.2 app/models/dorsale/address.rb
dorsale-2.6.1 app/models/dorsale/address.rb
dorsale-2.6.0 app/models/dorsale/address.rb
dorsale-2.5.0 app/models/dorsale/address.rb
dorsale-2.4.3 app/models/dorsale/address.rb
dorsale-2.4.2 app/models/dorsale/address.rb