effective_addresses 1.11.0 → 1.11.2

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
  SHA256:
3
- metadata.gz: 0a84c53daf0da709a7c9a0e0955a6caa478bbae7f51a0160b8da0c53dd9b1c3c
4
- data.tar.gz: f2d4a9d10ecabb3810273a337daad615145ed0fa275cd26bfa27befdee94b71b
3
+ metadata.gz: e66533e87c7a7da2a8328a1adab981fa04b84fc694e9563dc7775a131953d167
4
+ data.tar.gz: 1f5b37866d4ecd280033175ffb19752a3014bb90cc551d3368cd42b5f3cd422f
5
5
  SHA512:
6
- metadata.gz: 1f94f011510a25b84edcee947c351dd993c44a6c661ac41e4680bce60761802bc6f40c66ddf39adff6388001b16ca34055674fb4c969c31a16cc51cec185aced
7
- data.tar.gz: 171efa37a84a9f6b74cba09197c9520f3db0262cbec987aa106524dfb55298361fcb4da4fbf61f58ce82f8fcfc3d8f8854eac2573b9f1b0929f21d04b5905fa2
6
+ metadata.gz: aead11f98356d3cfe682606f761ee150414bd0e98c6932cce5657354bd5e8c8c1d14cd172db86dc0aa7dffc3f978656baef91402d52fbc6f10895de2f85ef1d3
7
+ data.tar.gz: 9340f0b4ccff8dd533c0a045e089a11cfa0fb4af00a3ad62ad4a548582b74de4a6a997df5700db7e55dd02e5003420239611f689de120baea62e41f2f37f8813
@@ -15,6 +15,8 @@ module ActsAsAddressable
15
15
  included do
16
16
  has_many :addresses, -> { order(:updated_at) }, as: :addressable, class_name: 'Effective::Address', dependent: :delete_all, autosave: true
17
17
 
18
+ scope :deep_effective_addresses, -> { includes(:addresses) }
19
+
18
20
  # Normalize categories
19
21
  categories = @acts_as_addressable_opts.try(:flatten) || []
20
22
 
@@ -1,9 +1,9 @@
1
1
  = f.fields_for method, (address || f.object.send(method) || f.object.addresses.build(category: method.to_s.gsub('_address', ''))) do |fa|
2
2
  - uuid = fa.object_id
3
3
  - method = method.to_sym
4
- - same_as_billing = (fa.object.category == 'shipping') && (f.object.try(:shipping_address_same_as_billing?) || false)
4
+ - same_as_billing = (fa.object.category == 'shipping') && f.object.try(:shipping_address_same_as_billing?)
5
5
  - required = (required && !same_as_billing)
6
- - wrapper_options = (same_as_billing ? { style: 'display: none;', class: 'form-group shipping_address_form_group' } : {})
6
+ - wrapper_options = { class: "form-group #{method}_form_group", style: ('display: none;' if same_as_billing) }
7
7
 
8
8
  - if ((f.object.errors.include?(method) && !f.object.errors.include?(:addresses)) rescue false)
9
9
  = f.errors method
@@ -1,3 +1,3 @@
1
1
  module EffectiveAddresses
2
- VERSION = '1.11.0'.freeze
2
+ VERSION = '1.11.2'.freeze
3
3
  end
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.11.0
4
+ version: 1.11.2
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: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails