app/models/address.rb in has_addresses-0.0.1 vs app/models/address.rb in has_addresses-0.0.2
- old
+ new
@@ -1,11 +1,11 @@
# Represents a mailing address
class Address < ActiveRecord::Base
- belongs_to :addressable,
- :polymorphic => true
- belongs_to :region
- belongs_to :country
+ belongs_to :addressable,
+ :polymorphic => true
+ belongs_to :region
+ belongs_to :country
validates_presence_of :addressable_id,
:addressable_type,
:street_1,
:city,
@@ -16,11 +16,11 @@
:if => :custom_region_required?
validates_format_of :postal_code,
:with => /^[0-9]{5}$/,
:allow_nil => true
- before_save :ensure_exclusive_references
+ before_save :ensure_exclusive_references
# Returns the region's country if the region is specified
def country_with_region_check
region ? region.country : country_without_region_check
end
@@ -79,6 +79,6 @@
self.custom_region = nil
end
true
end
-end
\ No newline at end of file
+end