effective_addresses 1.8.3 → 1.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_addresses/shipping_address_same_as_billing.js.coffee +1 -0
- data/app/models/concerns/acts_as_addressable.rb +2 -0
- data/app/models/effective/address.rb +1 -0
- data/app/views/effective/addresses/_address.html.haml +7 -0
- data/app/views/effective/addresses/_form_with.html.haml +7 -0
- data/app/views/effective/addresses/_formtastic.html.haml +3 -0
- data/config/locales/simple_form.en.yml +1 -0
- data/db/migrate/01_create_effective_addresses.rb.erb +4 -0
- data/lib/effective_addresses/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff3f966afab7e2c3b8199c448af7fea1ceee0411
|
4
|
+
data.tar.gz: ff0c0b5f1b79f540088db80a4199204873ff6e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aafa438364c21b562ab22fbfd5456f5ea760aeec032d243daa5f14571e9cb6cb1e77c62b249425b6a7554a4230648f2ff78cf4975328c0f6bbeb1eb78225e011
|
7
|
+
data.tar.gz: 12fc4c7ad7132879f28e982aa7e4a658879c5e670f2d1eac59db063997e09db6a7d17a2a4389b0dc320f33751385085261487bbc3ead260c4cdfd84b3bd90bcb
|
@@ -5,6 +5,7 @@ $(document).on 'change', "input[name$='[shipping_address][shipping_address_same_
|
|
5
5
|
div[class*='_shipping_address_full_name'],
|
6
6
|
div[class*='_shipping_address_address1'],
|
7
7
|
div[class*='_shipping_address_address2'],
|
8
|
+
div[class*='_shipping_address_address3'],
|
8
9
|
div[class*='_shipping_address_city'],
|
9
10
|
div[class*='_shipping_address_country_code'],
|
10
11
|
div[class*='_shipping_address_state_code'],
|
@@ -91,6 +91,7 @@ module ActsAsAddressable
|
|
91
91
|
existing.full_name = address.full_name
|
92
92
|
existing.address1 = address.address1
|
93
93
|
existing.address2 = address.address2
|
94
|
+
existing.address3 = address.address3 if address.respond_to?(:address3)
|
94
95
|
existing.city = address.city
|
95
96
|
existing.state_code = address.state_code
|
96
97
|
existing.country_code = address.country_code
|
@@ -116,6 +117,7 @@ module ActsAsAddressable
|
|
116
117
|
existing.full_name = address.full_name
|
117
118
|
existing.address1 = address.address1
|
118
119
|
existing.address2 = address.address2
|
120
|
+
existing.address3 = address.address3 if address.respond_to?(:address3)
|
119
121
|
existing.city = address.city
|
120
122
|
existing.state_code = address.state_code
|
121
123
|
existing.country_code = address.country_code
|
@@ -111,6 +111,7 @@ module Effective
|
|
111
111
|
output += "#{full_name}\n" if full_name.present?
|
112
112
|
output += "#{address1}\n" if address1.present?
|
113
113
|
output += "#{address2}\n" if address2.present?
|
114
|
+
output += "#{address3}\n" if respond_to?(:address3) && address3.present?
|
114
115
|
output += [city.presence, state_code.presence, " #{postal_code.presence}"].compact.join(' ')
|
115
116
|
output += "\n"
|
116
117
|
output += country.to_s
|
@@ -8,9 +8,16 @@
|
|
8
8
|
|
9
9
|
= address.address1
|
10
10
|
%br
|
11
|
+
|
11
12
|
- if address.address2.present?
|
12
13
|
= address.address2
|
13
14
|
%br
|
15
|
+
|
16
|
+
- if address.respond_to?(:address3) && address.address3.present?
|
17
|
+
= address.address3
|
18
|
+
%br
|
19
|
+
|
14
20
|
= [address.city.presence, address.state_code.presence, ' ' + address.postal_code.presence].compact.join(' ').html_safe
|
21
|
+
|
15
22
|
%br
|
16
23
|
= address.country.to_s
|
@@ -26,6 +26,13 @@
|
|
26
26
|
disabled: same_as_billing,
|
27
27
|
wrapper: wrapper_options
|
28
28
|
|
29
|
+
- if fa.object.respond_to?(:address3)
|
30
|
+
= fa.text_field :address3,
|
31
|
+
label: false,
|
32
|
+
required: false,
|
33
|
+
disabled: same_as_billing,
|
34
|
+
wrapper: wrapper_options
|
35
|
+
|
29
36
|
= fa.text_field :city,
|
30
37
|
required: required,
|
31
38
|
disabled: same_as_billing,
|
@@ -7,6 +7,10 @@ class CreateEffectiveAddresses < ActiveRecord::Migration[4.2]
|
|
7
7
|
t.string :full_name
|
8
8
|
t.string :address1
|
9
9
|
t.string :address2
|
10
|
+
|
11
|
+
# Uncomment this if you want 3 address fields
|
12
|
+
# t.string :address3
|
13
|
+
|
10
14
|
t.string :city
|
11
15
|
t.string :state_code
|
12
16
|
t.string :country_code
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_addresses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.5.2.3
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Extend any ActiveRecord object to have one or more named addresses. Includes
|