mas-rad_core 0.0.110 → 0.0.111

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b985bd80567865d81096344eb88804ea140bfe95
4
- data.tar.gz: 3c3c0bc1015d998cbc7f8e0d540a88d19bb5664a
3
+ metadata.gz: e869131245bd707351c3efa721f3de93e7e00ce0
4
+ data.tar.gz: 51d553bfaa928893fe47074df0a5973d7ae8ace6
5
5
  SHA512:
6
- metadata.gz: b0ed30a72f4f36e915b11b2d0ce35a656fc2567d1be66b66d033b5c2e59c8bb3d273c9a3f6ebfcdedc5795bb196cce0b6c074585ba7edb2be1c374d51c4aeafa
7
- data.tar.gz: bc633bec5bf507c87637b61f5ec535efc1c405658c47d83c4603dcd6622ace96188c1595a8e3d4bdcc9d4386904987fcf19e9fb4fe438c419e43ce8c77eaa1d2
6
+ metadata.gz: 97cd9f852d360f37b0c13c1f7ce993caa348a01168c844a775eac52e26762a903ed80974127f348b231b044452b059aea6dfb95a77ca697d0d53a548c94ceab3
7
+ data.tar.gz: ab95f1e20eda24e7507e0e8e2195ae13b8eadd6080912f232827e49eb7d2e01496be15384c196434512c0dd19248a6cdfda274d9c6cfa96b6cc65d9d439ec44f
data/app/models/office.rb CHANGED
@@ -67,8 +67,13 @@ class Office < ActiveRecord::Base
67
67
  return format_telephone_number(cleanup_telephone_number(super))
68
68
  end
69
69
 
70
+ # The Geocodable interface expect an object that responds to
71
+ # Geocodable#full_street_address. So, to respect the interface,
72
+ # we created internally the method postcode_only_address,
73
+ # to reflect what this object returns differently from the others.
74
+ #
70
75
  def full_street_address
71
- [address_line_one, address_line_two, address_postcode, 'United Kingdom'].reject(&:blank?).join(', ')
76
+ postcode_only_address
72
77
  end
73
78
 
74
79
  def has_address_changes?
@@ -92,6 +97,10 @@ class Office < ActiveRecord::Base
92
97
 
93
98
  private
94
99
 
100
+ def postcode_only_address
101
+ [address_postcode, 'United Kingdom'].join(', ')
102
+ end
103
+
95
104
  def postcode_is_valid
96
105
  if address_postcode.nil? || !UKPostcode.parse(address_postcode).full_valid?
97
106
  errors.add(:address_postcode, 'is invalid')
@@ -0,0 +1,5 @@
1
+ class AddWebsiteToOffice < ActiveRecord::Migration
2
+ def change
3
+ add_column :offices, :website, :string
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module MAS
2
2
  module RadCore
3
- VERSION = '0.0.110'
3
+ VERSION = '0.0.111'
4
4
  end
5
5
  end