fantasy_identifiable 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fantasy_identifiable/version.rb +1 -1
- data/lib/fantasy_identifiable.rb +3 -1
- 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: 79160e3561f69682c23f0d57666059f92cb6dc73e7b77ef570e58049670870ba
|
4
|
+
data.tar.gz: e3fdca79ea636c78ca8f12660984d58f5f77846401c61d1c189f5c76532c0365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7214f408f6a8258c46cb08d571bc740ff1fc93885985084641be378518a71e3c88d81964d4dcaf87bcc1a519bd956c78525627ddb5693ec30cf81f0de84593
|
7
|
+
data.tar.gz: 02b3578457201c8aebe985f61a158818f51b7fcffe65fd9fc1c91a5db120ff24d720361edb5b298244e98ef22cbfb08dce9518de50015e289b43d5f5fadfb1ac
|
data/lib/fantasy_identifiable.rb
CHANGED
@@ -14,6 +14,8 @@ module FantasyIdentifiable
|
|
14
14
|
|
15
15
|
def generate_identifiers
|
16
16
|
self.class.identifier_fields.each do |field_name, field_type|
|
17
|
+
next if self.identifier.present?
|
18
|
+
|
17
19
|
case field_type
|
18
20
|
when :friendly
|
19
21
|
set_friendly_identifier field_name
|
@@ -91,6 +93,6 @@ module FantasyIdentifiable
|
|
91
93
|
]
|
92
94
|
).sample(3) +
|
93
95
|
[friendly_token(3).downcase.tr("-_", "ab")]
|
94
|
-
).join("-").delete(" ").downcase
|
96
|
+
).join("-").delete(" ").downcase.gsub(/[^\-0-9A-Za-z]/, '')
|
95
97
|
end
|
96
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fantasy_identifiable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Rusa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.3.26
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Create unique fantasy names as identifier for your activerecord objects
|