duty_free 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87d07568c8c7a1692981435e098bd8426d17f30cd733ffff01a7b5a4e4fee4a9
4
- data.tar.gz: 1d2ef595a271f40e5489cac67e576b4f85338d43d46bff26c6e5a6d706766a00
3
+ metadata.gz: aa22e01d02997c6b8bc562f19805d1f0f529e17793b0dd14282f43840ea2c86c
4
+ data.tar.gz: afa848b412ea1514e0afeaa36ba1093ccb1baecdd4384d225b07f76145e9457e
5
5
  SHA512:
6
- metadata.gz: 4bdd6c53f65cb096de1c2da724a735ecee7ceaed464627f69adbb816b3afa20c85a202cce201a7ee5d35e52ae31663c7f8a9c02d47bc11ea7ead86cebfb0972f
7
- data.tar.gz: 4664e2b6e724f3bba469ef1907b82fe25d90761251ff5cabb204bd75e1a64b522ba3a438438a76e5d58e80952870334abb8194d9d0199b6e2addb2143120b5fa
6
+ metadata.gz: c60d6f2a72d34f4f99d3f9fea16b0ed2d1ff71b6088e4b6782a0b54decc15ef5ba45cef17f846079f4e5a55fd2f5dfcf25945b80351ff6006318b59fedcffd13
7
+ data.tar.gz: 6be734a732268268ef86768d88215e62b947c97326d823f3b631bab16de3f919877fedbf4184da1e1490904a752ed8e675bb173966cb9f2922860ae0b606020d
@@ -28,7 +28,9 @@ module DutyFree
28
28
  # sql_col = ::DutyFree::Util._prefix_join([table_name.compact.join('_'), name])
29
29
 
30
30
  # Foolproof way, using the AREL mapping:
31
- sql_col = ::DutyFree::Util._prefix_join([mapping["#{pre_prefix.tr('.', '_')}_#{prefix}_"], name])
31
+ this_pre_prefix = pre_prefix.tr('.', '_')
32
+ this_pre_prefix << '_' unless pre_prefix.blank?
33
+ sql_col = ::DutyFree::Util._prefix_join([mapping["#{this_pre_prefix}#{prefix}_"], name])
32
34
  sym = to_sym.to_s
33
35
  sql_col == sym ? sql_col : "#{sql_col} AS #{sym}"
34
36
  end
@@ -46,7 +46,7 @@ module DutyFree
46
46
  end
47
47
  (is_required ? '* ' : '') + col
48
48
  end
49
- rows = Array(rows)
49
+ rows = [rows]
50
50
 
51
51
  if is_with_data
52
52
  # Automatically create a JOINs strategy and select list to get back all related rows
@@ -55,8 +55,7 @@ module DutyFree
55
55
 
56
56
  # So we can properly create the SELECT list, create a mapping between our
57
57
  # column alias prefixes and the aliases AREL creates.
58
- # Warning: Delegating ast to arel is deprecated and will be removed in Rails 6.0
59
- arel_alias_names = ::DutyFree::Util._recurse_arel(relation.ast.cores.first.source)
58
+ arel_alias_names = ::DutyFree::Util._recurse_arel(relation.arel.ast.cores.first.source)
60
59
  our_names = ::DutyFree::Util._recurse_arel(template_joins)
61
60
  mapping = our_names.zip(arel_alias_names).to_h
62
61
 
@@ -87,7 +86,7 @@ module DutyFree
87
86
  else
88
87
  suggest_template(0, false, false)
89
88
  end
90
- puts "Chose #{import_template}"
89
+ # puts "Chose #{import_template}"
91
90
  inserts = []
92
91
  updates = []
93
92
  counts = Hash.new { |h, k| h[k] = [] }
@@ -581,7 +580,7 @@ module DutyFree
581
580
  klass.instance_variable_set(:@template_detail_columns, (template_detail_columns = nil))
582
581
  end
583
582
  unless template_detail_columns
584
- puts "* Redoing *"
583
+ # puts "* Redoing *"
585
584
  template_detail_columns = _recurse_def(klass, import_template[:all], import_template).first.map(&:to_sym)
586
585
  klass.instance_variable_set(:@template_detail_columns, template_detail_columns)
587
586
  end
@@ -5,7 +5,7 @@ module DutyFree
5
5
  module VERSION
6
6
  MAJOR = 1
7
7
  MINOR = 0
8
- TINY = 1
8
+ TINY = 2
9
9
 
10
10
  # PRE is nil unless it's a pre-release (beta, RC, etc.)
11
11
  PRE = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duty_free
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lorin Thwaits