friendly_id-mobility 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +5 -5
- data/README.md +2 -2
- data/lib/friendly_id/mobility/version.rb +1 -1
- data/lib/friendly_id/mobility.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da48ff2e6d8e7b0ea037e9a03b0b4c2988daf268adda2aac5193963d05bb4e27
|
4
|
+
data.tar.gz: ee15149efe01574a05a189f77b89bd0bb0339e00cb797636358f4aaa023e2766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e726d2b956f6f89d9fcca3b65d9d52aa230308417086edc4de21c75b4f9fb5467c8b3239a4c841e563a4d567e6d7ee06d8bcf4f81f88ee1da392411106f7a2a
|
7
|
+
data.tar.gz: fffd9dbacbdef0cca9736f8528a9055a48d73ac2f1f5c9ac4ac8859b4036b479db822222af54e65c57b7d230b9ce74316e0e8872d86f1f2eceb3c0f52857b48c
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
## 1.0
|
4
4
|
|
5
|
+
### 1.0.4
|
6
|
+
* Convert field from symbol to string value when comparing with
|
7
|
+
`mobility_attributes`
|
8
|
+
([#29](https://github.com/shioyama/friendly_id-mobility/pull/29)) thanks
|
9
|
+
[mrbrdo](https://github.com/mrbrdo)
|
10
|
+
|
11
|
+
### 1.0.3
|
12
|
+
* Ensure regex does not trigger on changes unrelated to translated attributes
|
13
|
+
([#26](https://github.com/shioyama/friendly_id-mobility/pull/26)) thanks
|
14
|
+
[kevynlebouille](https://github.com/kevynlebouille)!
|
15
|
+
|
5
16
|
### 1.0.2
|
6
17
|
|
7
18
|
* Depend on Mobility 1.0.1 to avoid need for `const_get`
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
friendly_id-mobility (0.
|
5
|
-
friendly_id (>= 5.0.0,
|
6
|
-
mobility (>= 0.
|
4
|
+
friendly_id-mobility (1.0.2)
|
5
|
+
friendly_id (>= 5.0.0, < 5.5)
|
6
|
+
mobility (>= 1.0.1, < 2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -71,7 +71,7 @@ GEM
|
|
71
71
|
database_cleaner (1.8.5)
|
72
72
|
diff-lcs (1.4.4)
|
73
73
|
erubi (1.10.0)
|
74
|
-
friendly_id (5.4.
|
74
|
+
friendly_id (5.4.1)
|
75
75
|
activerecord (>= 4.0.0)
|
76
76
|
generator_spec (0.9.4)
|
77
77
|
activesupport (>= 3.0.0)
|
@@ -92,7 +92,7 @@ GEM
|
|
92
92
|
mini_mime (1.0.2)
|
93
93
|
mini_portile2 (2.4.0)
|
94
94
|
minitest (5.14.2)
|
95
|
-
mobility (0.
|
95
|
+
mobility (1.0.1)
|
96
96
|
i18n (>= 0.6.10, < 2)
|
97
97
|
request_store (~> 1.0)
|
98
98
|
nio4r (2.5.4)
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Installation
|
|
18
18
|
Add this line to your application's Gemfile:
|
19
19
|
|
20
20
|
```ruby
|
21
|
-
gem 'friendly_id-mobility', '~> 1.0.
|
21
|
+
gem 'friendly_id-mobility', '~> 1.0.4'
|
22
22
|
```
|
23
23
|
|
24
24
|
And then execute:
|
@@ -41,7 +41,7 @@ your Mobility configuration:
|
|
41
41
|
Mobility.configure do
|
42
42
|
plugins do
|
43
43
|
# ...
|
44
|
-
|
44
|
+
dirty
|
45
45
|
# ...
|
46
46
|
end
|
47
47
|
end
|
data/lib/friendly_id/mobility.rb
CHANGED
@@ -31,7 +31,7 @@ module FriendlyId
|
|
31
31
|
|
32
32
|
def advise_against_untranslated_model(model)
|
33
33
|
field = model.friendly_id_config.query_field
|
34
|
-
if model.included_modules.grep(::Mobility::Translations).empty? || model.mobility_attributes.exclude?(field)
|
34
|
+
if model.included_modules.grep(::Mobility::Translations).empty? || model.mobility_attributes.exclude?(field.to_s)
|
35
35
|
raise "[FriendlyId] You need to translate the '#{field}' field with " \
|
36
36
|
"Mobility (add 'translates :#{field}' in your model '#{model.name}')"
|
37
37
|
end
|
@@ -52,7 +52,7 @@ module FriendlyId
|
|
52
52
|
def set_slug(normalized_slug = nil)
|
53
53
|
super
|
54
54
|
changed.each do |change|
|
55
|
-
if change =~ /\A(?:#{friendly_id_config.base}|#{friendly_id_config.slug_column})_([a-z]{2}(_[a-z]{2})?)/
|
55
|
+
if change =~ /\A(?:#{friendly_id_config.base}|#{friendly_id_config.slug_column})_([a-z]{2}(_[a-z]{2})?)\Z/
|
56
56
|
locale, suffix = $1.split('_'.freeze)
|
57
57
|
locale = "#{locale}-#{suffix.upcase}".freeze if suffix
|
58
58
|
::Mobility.with_locale(locale) { super }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: friendly_id-mobility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Salzberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mobility
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.7
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Translate your FriendlyId slugs with Mobility.
|