mobility 1.2.3 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +0 -23
- data/README.md +1 -1
- data/lib/mobility/plugins/fallbacks.rb +16 -17
- data/lib/mobility/version.rb +1 -1
- data/lib/rails/generators/mobility/backend_generators/base.rb +3 -1
- data.tar.gz.sig +0 -0
- metadata +15 -13
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7f067617904bfb7739ce49cd155ffc0ec0b6aeeb7ebdbbf13309afd0e7a106
|
4
|
+
data.tar.gz: ced82292e8e99ee28bb7b3962e964147481200539db25d87bae0caa24fa783da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38494c35209217644cf9b408ce0d55c671b65db3b131118d0ce934b6065eccb0d64a032ede1dba0244cf28a3960973163f0c3ac31976fd8248eb514a750a0a49
|
7
|
+
data.tar.gz: fe5d5ef7ea05f091eaed43330b9f8e1b23716176daf2595a61fdb01344fc25cfa92a2ba237822e5b9bcec101c60f9d22ab63ae2cd59c888ff4315ac08150d49b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
## 1.2
|
4
4
|
|
5
|
+
### 1.2.6
|
6
|
+
- Require mfa on rubygems
|
7
|
+
([#545](https://github.com/shioyama/mobility/pull/545))
|
8
|
+
|
9
|
+
### 1.2.5
|
10
|
+
- Avoid referencing ActiveRecord::Base
|
11
|
+
([#550](https://github.com/shioyama/mobility/pull/550))
|
12
|
+
|
13
|
+
### 1.2.4
|
14
|
+
- Fix fallbacks performance regression
|
15
|
+
([#548](https://github.com/shioyama/mobility/pull/548))
|
16
|
+
|
5
17
|
### 1.2.3
|
6
18
|
- Fix passing wrong options to super in fallbacks plugin
|
7
19
|
([#539](https://github.com/shioyama/mobility/pull/539))
|
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 ||= '
|
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 '
|
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: 0a751a021bfc0c71bb2a10ff8af9654c785c94f1
|
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,10 @@ 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)
|
62
44
|
pry (0.13.1)
|
63
45
|
coderay (~> 1.1)
|
64
46
|
method_source (~> 1.0)
|
@@ -87,21 +69,16 @@ GEM
|
|
87
69
|
rspec-support (3.10.2)
|
88
70
|
shellany (0.0.1)
|
89
71
|
thor (1.1.0)
|
90
|
-
tzinfo (2.0.4)
|
91
|
-
concurrent-ruby (~> 1.0)
|
92
72
|
yard (0.9.26)
|
93
73
|
|
94
74
|
PLATFORMS
|
95
75
|
ruby
|
96
76
|
|
97
77
|
DEPENDENCIES
|
98
|
-
activerecord!
|
99
|
-
activesupport!
|
100
78
|
benchmark-ips
|
101
79
|
database_cleaner (~> 1.5, >= 1.5.3)
|
102
80
|
guard-rspec
|
103
81
|
mobility!
|
104
|
-
pg
|
105
82
|
pry-byebug
|
106
83
|
rake (~> 12, >= 12.2.1)
|
107
84
|
rspec (~> 3.0)
|
data/README.md
CHANGED
@@ -117,10 +117,21 @@ the current locale was +nil+.
|
|
117
117
|
# Applies fallbacks plugin to attributes. Completely disables fallbacks
|
118
118
|
# on model if option is +false+.
|
119
119
|
included_hook do |_, backend_class|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
120
|
+
unless options[:fallbacks] == false
|
121
|
+
backend_class.include(BackendInstanceMethods)
|
122
|
+
|
123
|
+
fallbacks =
|
124
|
+
if options[:fallbacks].is_a?(Hash)
|
125
|
+
generate_fallbacks(options[:fallbacks])
|
126
|
+
elsif options[:fallbacks] == true
|
127
|
+
generate_fallbacks({})
|
128
|
+
else
|
129
|
+
::Hash.new { [] }
|
130
|
+
end
|
131
|
+
|
132
|
+
backend_class.singleton_class.attr_reader :fallbacks
|
133
|
+
backend_class.instance_variable_set(:@fallbacks, fallbacks)
|
134
|
+
end
|
124
135
|
end
|
125
136
|
|
126
137
|
private
|
@@ -140,7 +151,7 @@ the current locale was +nil+.
|
|
140
151
|
def read(locale, fallback: true, **kwargs)
|
141
152
|
return super(locale, **kwargs) if !fallback || kwargs[:locale]
|
142
153
|
|
143
|
-
locales = fallback == true ? fallbacks[locale] : [locale, *fallback]
|
154
|
+
locales = fallback == true ? self.class.fallbacks[locale] : [locale, *fallback]
|
144
155
|
locales.each do |fallback_locale|
|
145
156
|
value = super(fallback_locale, **kwargs)
|
146
157
|
return value if Util.present?(value)
|
@@ -148,18 +159,6 @@ the current locale was +nil+.
|
|
148
159
|
|
149
160
|
super(locale, **kwargs)
|
150
161
|
end
|
151
|
-
|
152
|
-
private
|
153
|
-
|
154
|
-
def fallbacks
|
155
|
-
if options[:fallbacks].is_a?(Hash)
|
156
|
-
generate_fallbacks(options[:fallbacks])
|
157
|
-
elsif options[:fallbacks] == true
|
158
|
-
generate_fallbacks({})
|
159
|
-
else
|
160
|
-
::Hash.new { [] }
|
161
|
-
end
|
162
|
-
end
|
163
162
|
end
|
164
163
|
end
|
165
164
|
|
data/lib/mobility/version.rb
CHANGED
@@ -46,7 +46,9 @@ module Mobility
|
|
46
46
|
connection.data_source_exists?(table_name)
|
47
47
|
end
|
48
48
|
|
49
|
-
|
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
|
+
version: 1.2.6
|
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
|
MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0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h0IUaJa1pNY+MLTff9LE/qTl3WVTgrif
|
32
|
+
HsSSnstQYPSLJ3hSP/cu1aOmdXlJiim//XlDQ9DNp4KWje3UW3DMRdTwjW5wPmUq
|
33
|
+
VA9Ij7DUPaZzUpy1NZEigf1GshvslOnvN5bgol1YFR46jpfZVlgt0K5XBQVNvp/A
|
34
|
+
QHgocnSksU5GOM+G2UhjVycbTamd+bCxjWAZTEDZNafFt5CmnfK1D1UTIblR/ci9
|
35
|
+
fUDdW+GhxhobB8N1mtDRlhELoxLLjx7mSvJ3Wg==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2022-03-02 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
|