Class: Stay::Address
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Stay::Address
- Defined in:
- app/models/stay/address.rb
Constant Summary collapse
- STATES_REQUIRED =
The required states listed below match those used by PayPal and Shopify.
[ 'AU', 'AE', 'BR', 'CA', 'CN', 'ES', 'HK', 'IE', 'IN', 'IT', 'MY', 'MX', 'NZ', 'PT', 'RO', 'TH', 'US', 'ZA' ].freeze
Class Method Summary collapse
- .ransackable_associations(auth_object = nil) ⇒ Object
- .ransackable_attributes(auth_object = nil) ⇒ Object
Instance Method Summary collapse
Class Method Details
.ransackable_associations(auth_object = nil) ⇒ Object
28 29 30 |
# File 'app/models/stay/address.rb', line 28 def self.ransackable_associations(auth_object = nil) [ "properties", "user"] end |
.ransackable_attributes(auth_object = nil) ⇒ Object
32 33 34 |
# File 'app/models/stay/address.rb', line 32 def self.ransackable_attributes(auth_object = nil) ["address1", "address2", "city", "state", "country", "zipcode"] end |
Instance Method Details
#full_address ⇒ Object
36 37 38 |
# File 'app/models/stay/address.rb', line 36 def full_address [address1, address2, city.try(:name), state.try(:name), country.try(:name), zipcode].compact.join(', ') end |