friendly_uuid 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/friendly_uuid.rb +9 -1
  3. metadata +11 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a30a5351eaad80263a47cdfe1bb76994bbb93c9e455c56a32dbafa232f71b49a
4
- data.tar.gz: af3e8aa4a342a951e88626f2ca199f0017a63ba0a4fb9e5333d8f056720cdf9a
3
+ metadata.gz: 758a0f77edc544b560ea4cd7488a882689c71b02e0fd07bac1d4957995ad5de3
4
+ data.tar.gz: e1cfef7017d033c98a9789b8d60b17b9fb0db6ed4b4c2f927240791b4cf2c1f7
5
5
  SHA512:
6
- metadata.gz: 28a9eb11b1c06bacf19406691661162d7056d9d20c318d92b5bb7becf09daf2796552070f3341d682e46accfd41bc0818a7b11374257fa61332ee8032672fcfd
7
- data.tar.gz: 49b3acb11d0bd5209a34a163013a3083224f608164045fb1160d47bc1262d1c22f31196490858e215e8a53705e67fee2f6c56148ba4863a7cd1bd23fb9658414
6
+ metadata.gz: cc4de547875e962ddedf7c1ba406e7ae11d2a1a5a3b48dff1d5a64ab6f7a9e1f9fe3620ac2c291d44e1f16675a30280edce24b16dcf3df0ec4dcfed0e9580ebe
7
+ data.tar.gz: 11a12408b53044ac36f75fcdf2045004a14cec834b4375d7593ab71d70cc3d7781b324a31d55de580a4aab3484f33b49a33732a667a306a903d8fca6821813c1
data/lib/friendly_uuid.rb CHANGED
@@ -69,7 +69,7 @@ module FriendlyUUID
69
69
  end
70
70
 
71
71
  def substr_query
72
- case self.connection_config[:adapter]
72
+ case adapter
73
73
  when "mysql2"
74
74
  raise ValueError("Sorry, FriendlyUUID does not support MySQL")
75
75
  when "postgresql"
@@ -80,5 +80,13 @@ module FriendlyUUID
80
80
  raise ValueError("Unknown database type; FriendlyUUID cannot support it")
81
81
  end
82
82
  end
83
+
84
+ def adapter
85
+ if respond_to?(:connection_db_config)
86
+ connection_db_config.configuration_hash[:adapter]
87
+ else
88
+ connection_config[:adapter]
89
+ end
90
+ end
83
91
  end
84
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_uuid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Carlsson
@@ -10,8 +10,16 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-10-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: FriendlyUUID shortens every UUID to have only as many characters as it
14
- needs to be unique.
13
+ description: |2
14
+ FriendlyUUID is a Rails gem that shortens your UUID records' URLs.
15
+
16
+ What once was 758d633c-61d4-4dfc-ba52-b7b498971097 becomes 758d.
17
+
18
+ FriendlyUUID does not introduce any new state to your models, even under the hood.
19
+
20
+ FriendlyUUID URLs are exactly as unique as they need to be. The first record will be one character. Would-be collisions expand to two characters, and so on.
21
+
22
+ FriendlyUUID is inspired by friendly_id, but is focused on being lightweight and specific to models with UUID primary keys.
15
23
  email: qhiiyr@gmail.com
16
24
  executables: []
17
25
  extensions: []