arql 0.2.6 → 0.2.7

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: 92f3117b0baa9b0c54cc683a73251094697b5e2fb8ed7cb329f37b43ad0bbe2e
4
- data.tar.gz: 2b839cf6ec293f162faa2f29c7d7421679185c4874f1a4c826d13d4be26350a8
3
+ metadata.gz: 44604f0630f7b6308b9c53bf90b46bd9138b52fdec169baf46bf4e790adfc82b
4
+ data.tar.gz: 7efecc0c754d4f16eb31a19756de3d95a06d8d93440e480726d6df574827af13
5
5
  SHA512:
6
- metadata.gz: c07790dbd1bbff85f9fee6f86346967ecac0e70c0334255eb7041b475a41b7d569a01f40d0d2f8757de34362dcaaff839e31a27d13865f1f40f533ce409388fc
7
- data.tar.gz: a82ae15b63a25e22e7a50e6a1a1dc8173dc5881c5c032851fe69e8639dcfc860d734a557f74dfce38868dac2dd86b2f9e2c94b8e487fa17271967b0eb56d6367
6
+ metadata.gz: d795bedb12d2bf39bbb2b5e394373b545e35a542e00110708915fa57b5ca2248f5ed64ee975283d0a3a23e3e4ed201a560fc3ba78dac4085650d6eef486c7fdf
7
+ data.tar.gz: 07c6aacfcd46fe3361ebbf977c553c32aad792cb7cd40ebdb9803f0cb76b32ace4bb4326808dd4db2c61be2f6e3e98ec1ee85753ced7e73ee85f8d1f6ffaf10d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.2.6)
4
+ arql (0.2.7)
5
5
  activerecord (~> 6.0.3)
6
6
  activesupport (~> 6.0.3)
7
7
  caxlsx (~> 3.0.2)
@@ -107,10 +107,15 @@ module Arql
107
107
  end
108
108
  end.tap do |clazz|
109
109
  Object.const_set(const_name, clazz).tap do |const|
110
- const_name.gsub(/[a-z]*/, '').tap do |abbr|
111
- unless Object.const_defined?(abbr)
112
- Object.const_set abbr, const
113
- abbr_const = abbr
110
+ const_name.gsub(/[a-z]*/, '').tap do |bare_abbr|
111
+ abbr_const = nil
112
+ 9.times do |idx|
113
+ abbr = idx.zero? ? bare_abbr : "#{bare_abbr}#{idx+1}"
114
+ unless Object.const_defined?(abbr)
115
+ Object.const_set abbr, const
116
+ abbr_const = abbr
117
+ break
118
+ end
114
119
  end
115
120
 
116
121
  @@models << {
@@ -161,10 +166,15 @@ module Arql
161
166
  end
162
167
  end.tap do |clazz|
163
168
  Object.const_set(const_name, clazz).tap do |const|
164
- const_name.gsub(/[a-z]*/, '').tap do |abbr|
165
- unless Object.const_defined?(abbr)
166
- Object.const_set abbr, const
167
- abbr_const = abbr
169
+ const_name.gsub(/[a-z]*/, '').tap do |bare_abbr|
170
+ abbr_const = nil
171
+ 9.times do |idx|
172
+ abbr = idx.zero? ? bare_abbr : "#{bare_abbr}#{idx+1}"
173
+ unless Object.const_defined?(abbr)
174
+ Object.const_set abbr, const
175
+ abbr_const = abbr
176
+ break
177
+ end
168
178
  end
169
179
 
170
180
  @@models << {
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang