mobility 1.2.4 → 1.2.7

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: d0dd974f8a077b31fc0ab41df158e4cac50c6aee4e7fd66348db1ed2ef5f78f9
4
- data.tar.gz: ea72521a4bb8daedf08d3012353c591ec47f76e3fe6ec3c10b87e331a5404db9
3
+ metadata.gz: f9ff30d2d033cff7555cc4a4ed4d463d7670df67e4e23302534f35fc6bf34649
4
+ data.tar.gz: d3097e35c0d8e6fc65c88fc038fcb056add50c4a87384ece6e71321c33a71aac
5
5
  SHA512:
6
- metadata.gz: 15b9df45774c9b3d4ae343b2f083b2a85ddfd7585283998b0dc624aa62eee5c6e5fade0737ae78b3dd728dd273a03dcf10afecabcca6eb8f90400619de0a7fa4
7
- data.tar.gz: 1f199821139bf35b4e176f52dac0249f482ffb5edc9d7957d437e9262a908812fab01ba5dea52e18a9b1f37f92744b345c34ca0c84d97da0641f9fab19577704
6
+ metadata.gz: 10b8f7d41910f51e21fbf6ad5603e284070c202d224518b788067df6ea4fc77f180b2273498307a8f5d77f88963eee06917bea68f51a41d98308c60bc2091cf5
7
+ data.tar.gz: 20cdcc3adc28dae960ea83a58b1aa2ba92515e824a6ebe35a4bb3d896c9b0eae3aae0b8198c32304dfb9d2eec8a794b427a50f3f4f0c75e0b2e8d307ad40fb69
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## 1.2
4
4
 
5
+ ### 1.2.7
6
+ - Do not query same attribute more than once, fixes
7
+ [#564](https://github.com/shioyama/mobility/pull/578)
8
+ ([#577](https://github.com/shioyama/mobility/pull/577))
9
+
10
+ ### 1.2.6
11
+ - Require mfa on rubygems
12
+ ([#545](https://github.com/shioyama/mobility/pull/545))
13
+
14
+ ### 1.2.5
15
+ - Avoid referencing ActiveRecord::Base
16
+ ([#550](https://github.com/shioyama/mobility/pull/550))
17
+
5
18
  ### 1.2.4
6
19
  - Fix fallbacks performance regression
7
20
  ([#548](https://github.com/shioyama/mobility/pull/548))
data/Gemfile CHANGED
@@ -8,11 +8,11 @@ orm, orm_version = ENV['ORM'], ENV['ORM_VERSION']
8
8
  group :development, :test do
9
9
  case orm
10
10
  when 'active_record'
11
- orm_version ||= '6.1'
11
+ orm_version ||= '7.0'
12
12
  case orm_version
13
- when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1'
13
+ when '4.2', '5.0', '5.1', '5.2', '6.0', '6.1', '7.0'
14
14
  gem 'activerecord', "~> #{orm_version}.0"
15
- when '7.0'
15
+ when 'edge'
16
16
  git 'https://github.com/rails/rails.git', branch: 'main' do
17
17
  gem 'activerecord'
18
18
  gem 'activesupport'
data/Gemfile.lock CHANGED
@@ -1,19 +1,3 @@
1
- GIT
2
- remote: https://github.com/rails/rails.git
3
- revision: 5647a9c1ced68d20338552d47a3b755e10a271c4
4
- branch: main
5
- specs:
6
- activemodel (7.0.0.alpha2)
7
- activesupport (= 7.0.0.alpha2)
8
- activerecord (7.0.0.alpha2)
9
- activemodel (= 7.0.0.alpha2)
10
- activesupport (= 7.0.0.alpha2)
11
- activesupport (7.0.0.alpha2)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 1.6, < 2)
14
- minitest (>= 5.1)
15
- tzinfo (~> 2.0)
16
-
17
1
  PATH
18
2
  remote: .
19
3
  specs:
@@ -53,12 +37,11 @@ GEM
53
37
  rb-inotify (~> 0.9, >= 0.9.10)
54
38
  lumberjack (1.2.8)
55
39
  method_source (1.0.0)
56
- minitest (5.14.4)
57
40
  nenv (0.3.0)
58
41
  notiffany (0.1.3)
59
42
  nenv (~> 0.1)
60
43
  shellany (~> 0.0)
61
- pg (1.2.3)
44
+ pg (1.3.5)
62
45
  pry (0.13.1)
63
46
  coderay (~> 1.1)
64
47
  method_source (~> 1.0)
@@ -85,18 +68,15 @@ GEM
85
68
  diff-lcs (>= 1.2.0, < 2.0)
86
69
  rspec-support (~> 3.10.0)
87
70
  rspec-support (3.10.2)
71
+ sequel (5.57.0)
88
72
  shellany (0.0.1)
89
73
  thor (1.1.0)
90
- tzinfo (2.0.4)
91
- concurrent-ruby (~> 1.0)
92
74
  yard (0.9.26)
93
75
 
94
76
  PLATFORMS
95
77
  ruby
96
78
 
97
79
  DEPENDENCIES
98
- activerecord!
99
- activesupport!
100
80
  benchmark-ips
101
81
  database_cleaner (~> 1.5, >= 1.5.3)
102
82
  guard-rspec
@@ -105,6 +85,7 @@ DEPENDENCIES
105
85
  pry-byebug
106
86
  rake (~> 12, >= 12.2.1)
107
87
  rspec (~> 3.0)
88
+ sequel (~> 5.0)
108
89
  yard (~> 0.9.0)
109
90
 
110
91
  BUNDLED WITH
data/README.md CHANGED
@@ -55,7 +55,7 @@ Installation
55
55
  Add this line to your application's Gemfile:
56
56
 
57
57
  ```ruby
58
- gem 'mobility', '~> 1.2.4'
58
+ gem 'mobility', '~> 1.2.7'
59
59
  ```
60
60
 
61
61
  ### ActiveRecord (Rails)
@@ -223,10 +223,13 @@ enabled for any one attribute on the model.
223
223
 
224
224
  keys, predicates = opts.keys.map(&:to_s), []
225
225
 
226
+ used_keys = []
227
+
226
228
  query_map = mods.inject(IDENTITY) do |qm, mod|
227
- i18n_keys = mod.names & keys
229
+ i18n_keys = mod.names & keys - used_keys
228
230
  next qm if i18n_keys.empty?
229
231
 
232
+ used_keys += i18n_keys
230
233
  mod_predicates = i18n_keys.map do |key|
231
234
  build_predicate(scope.backend_node(key.to_sym, locale), opts.delete(key))
232
235
  end
@@ -135,10 +135,13 @@ ActiveRecord query plugin.
135
135
  keys, predicates = cond.keys, []
136
136
  model = dataset.model
137
137
 
138
+ used_keys = []
139
+
138
140
  query_map = attribute_modules(model).inject(IDENTITY) do |qm, mod|
139
- i18n_keys = mod.names.map(&:to_sym) & keys
141
+ i18n_keys = mod.names.map(&:to_sym) & keys - used_keys
140
142
  next qm if i18n_keys.empty?
141
143
 
144
+ used_keys += i18n_keys
142
145
  mod_predicates = i18n_keys.map do |key|
143
146
  build_predicate(dataset.backend_op(key, locale), cond.delete(key))
144
147
  end
@@ -8,7 +8,7 @@ module Mobility
8
8
  module VERSION
9
9
  MAJOR = 1
10
10
  MINOR = 2
11
- TINY = 4
11
+ TINY = 7
12
12
  PRE = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -46,7 +46,9 @@ module Mobility
46
46
  connection.data_source_exists?(table_name)
47
47
  end
48
48
 
49
- delegate :connection, to: ::ActiveRecord::Base
49
+ def connection
50
+ ::ActiveRecord::Base.connection
51
+ end
50
52
 
51
53
  def truncate_index_name(index_name)
52
54
  if index_name.size < connection.index_name_length
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
@@ -11,8 +11,8 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhjaHJp
14
- cy9EQz1kZWppbWF0YS9EQz1jb20wHhcNMjEwMjE4MTMxMzA5WhcNMjIwMjE4MTMx
15
- MzA5WjAjMSEwHwYDVQQDDBhjaHJpcy9EQz1kZWppbWF0YS9EQz1jb20wggGiMA0G
14
+ cy9EQz1kZWppbWF0YS9EQz1jb20wHhcNMjIwMzAyMDMyMTA5WhcNMjMwMzAyMDMy
15
+ MTA5WjAjMSEwHwYDVQQDDBhjaHJpcy9EQz1kZWppbWF0YS9EQz1jb20wggGiMA0G
16
16
  CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDURCKbt5oY0sCp4kYK1u5SLzVHg6Q1
17
17
  2LejeQvUGpR3gulWqrq/507XRxE/9FSpLfgo3cGGY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cfYrnXtmC9wh+5/0UqAeoan9RiSd8lscQZ9pEY0E3cmzJRHSU
30
+ t8kwB2ipVkFO17mdTVgc3C2ZbWRq80eTzkELDBb+8xO0Cskyh4sGMTOKfHs2RWcJ
31
+ 217Qeg0F9w0RcqwnORe5zmPihY9zswCPh0IUaJa1pNY+MLTff9LE/qTl3WVTgrif
32
+ HsSSnstQYPSLJ3hSP/cu1aOmdXlJiim//XlDQ9DNp4KWje3UW3DMRdTwjW5wPmUq
33
+ VA9Ij7DUPaZzUpy1NZEigf1GshvslOnvN5bgol1YFR46jpfZVlgt0K5XBQVNvp/A
34
+ QHgocnSksU5GOM+G2UhjVycbTamd+bCxjWAZTEDZNafFt5CmnfK1D1UTIblR/ci9
35
+ fUDdW+GhxhobB8N1mtDRlhELoxLLjx7mSvJ3Wg==
36
36
  -----END CERTIFICATE-----
37
- date: 2021-11-28 00:00:00.000000000 Z
37
+ date: 2022-06-18 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: request_store
@@ -249,7 +249,9 @@ licenses:
249
249
  metadata:
250
250
  homepage_uri: https://github.com/shioyama/mobility
251
251
  source_code_uri: https://github.com/shioyama/mobility
252
+ bug_tracker_uri: https://github.com/shioyama/mobility/issues
252
253
  changelog_uri: https://github.com/shioyama/mobility/blob/master/CHANGELOG.md
254
+ rubygems_mfa_required: 'true'
253
255
  post_install_message: |2
254
256
 
255
257
  Warning: Mobility v1.0 includes backwards-incompatible changes (mostly around configuration).
metadata.gz.sig CHANGED
Binary file