effective_addresses 1.6.2 → 1.6.3
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/controllers/effective/addresses_controller.rb +1 -1
- data/app/models/effective/address.rb +5 -2
- data/app/views/effective/addresses/_address_fields_formtastic.html.haml +2 -2
- data/app/views/effective/addresses/_address_fields_simple_form.html.haml +2 -0
- data/lib/effective_addresses/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a8531e0a31f4d58907f8bcb3bacaaae1af4cfb7
|
4
|
+
data.tar.gz: aae93b337212735a1b73c96a5c29563c3a2beb24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0884e243f405c371070fe834fa76bf6b25783320c9733bd1068238130377ca2a048719e0f977c4712db553a6fcc1ca7ecafc44d4d3a9c5e8f079e69ce0424bc1
|
7
|
+
data.tar.gz: b709b990babe0e6a6f1ba171afc0e7e700b16e8831cb29564af184ef7bd0f809bfbb15b81b7e921f11ba84e374782d909f3905cf80871aba04db1df8f47eec03
|
@@ -2,6 +2,7 @@ $(document).on 'change', "input[name$='[shipping_address][shipping_address_same_
|
|
2
2
|
$obj = $(event.currentTarget)
|
3
3
|
|
4
4
|
shipping_fields = $obj.closest('form').find("
|
5
|
+
div[class*='_shipping_address_full_name'],
|
5
6
|
div[class*='_shipping_address_address1'],
|
6
7
|
div[class*='_shipping_address_address2'],
|
7
8
|
div[class*='_shipping_address_city'],
|
@@ -123,8 +123,11 @@ module Effective
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def shipping_address_same_as_billing?
|
126
|
-
::ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES
|
126
|
+
if defined?(::ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES) # Rails 5
|
127
|
+
::ActiveRecord::ConnectionAdapters::Column::TRUE_VALUES.include?(self.shipping_address_same_as_billing)
|
128
|
+
else
|
129
|
+
ActiveRecord::Type::Boolean.new.cast(self.shipping_address_same_as_billing)
|
130
|
+
end
|
127
131
|
end
|
128
|
-
|
129
132
|
end
|
130
133
|
end
|
@@ -13,10 +13,10 @@
|
|
13
13
|
= fa.input :full_name, :required => true, :label => 'Full name', :placeholder => 'Full name'
|
14
14
|
|
15
15
|
- when :address1
|
16
|
-
= fa.input :address1, :placeholder => 'Address', :label => "Address
|
16
|
+
= fa.input :address1, :placeholder => 'Address', :label => "Address"
|
17
17
|
|
18
18
|
- when :address2
|
19
|
-
= fa.input :address2, :label =>
|
19
|
+
= fa.input :address2, :label => false
|
20
20
|
|
21
21
|
- when :city
|
22
22
|
= fa.input :city, :placeholder => 'City'
|
@@ -18,12 +18,14 @@
|
|
18
18
|
|
19
19
|
- when :address1
|
20
20
|
= fa.input :address1,
|
21
|
+
label: 'Address',
|
21
22
|
required: required,
|
22
23
|
disabled: shipping_address_same_as_billing,
|
23
24
|
wrapper_html: { style: ('display: none;' if shipping_address_same_as_billing) }
|
24
25
|
|
25
26
|
- when :address2
|
26
27
|
= fa.input :address2,
|
28
|
+
label: false,
|
27
29
|
required: false,
|
28
30
|
disabled: shipping_address_same_as_billing,
|
29
31
|
wrapper_html: { style: ('display: none;' if shipping_address_same_as_billing) }
|
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.6.
|
4
|
+
version: 1.6.3
|
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: 2016-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|