active_uxid 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/active_uxid.rb +4 -3
- data/lib/active_uxid/settings.rb +0 -1
- data/lib/active_uxid/version.rb +1 -1
- data/lib/generators/active_uxid/templates/install.rb +0 -1
- metadata +1 -2
- data/lib/active_uxid/record.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9e877324685040eaccc2853d70c73ebd63cf4f
|
4
|
+
data.tar.gz: 37746f142994446134fd083d2afa48b1e5801b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69f643b10dfa00a01bcea7982ec826b29435a126a8fa46881f0a35352334cd6979baf76d6db168b68fba1927f2987b34d6c248895b0c7ba6aa794b07876d8e03
|
7
|
+
data.tar.gz: e583c353c3efb0f1bb3f5102325658e26f98b5a5a2b6ac548f4d8d5448ab9e0db56fb735b2d992ae462fe58069f448afb652bb4b356910c559a5a26e5cf47a36
|
data/README.md
CHANGED
@@ -35,7 +35,6 @@ Or install it yourself as:
|
|
35
35
|
|
36
36
|
```ruby
|
37
37
|
ActiveUxid::Settings.configure do |config|
|
38
|
-
config.encoder_type = 'ulid'
|
39
38
|
config.encoding_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
40
39
|
config.encoding_length = 26
|
41
40
|
config.encoding_salt = 1369136
|
@@ -63,9 +62,10 @@ ActiveUxid::Ulid.encode #=> '1mqfg9qa96s8s5f02o1ucf8lcc'
|
|
63
62
|
```ruby
|
64
63
|
class User < ActiveRecord::Base
|
65
64
|
# Add a uxid binary attribute to the corresponding table.
|
66
|
-
# This will include the proper UXid format from your settings
|
67
65
|
|
68
|
-
include ActiveUxid::Record
|
66
|
+
include ActiveUxid::Record::Hash
|
67
|
+
# Or
|
68
|
+
include ActiveUxid::Record::Ulid
|
69
69
|
end
|
70
70
|
|
71
71
|
# Hash UXid's type only
|
data/lib/active_uxid.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
%w[
|
4
|
-
require "active_uxid
|
3
|
+
%w[version settings].each do |file_name|
|
4
|
+
require "active_uxid/#{file_name}"
|
5
5
|
end
|
6
6
|
|
7
|
-
%w[
|
7
|
+
%w[base hash ulid].each_with_index do |file_name, i|
|
8
|
+
require "active_uxid/record/#{file_name}" unless i.zero?
|
8
9
|
require "active_uxid/#{file_name}"
|
9
10
|
end
|
10
11
|
|
data/lib/active_uxid/settings.rb
CHANGED
data/lib/active_uxid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_uxid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -203,7 +203,6 @@ files:
|
|
203
203
|
- lib/active_uxid.rb
|
204
204
|
- lib/active_uxid/base.rb
|
205
205
|
- lib/active_uxid/hash.rb
|
206
|
-
- lib/active_uxid/record.rb
|
207
206
|
- lib/active_uxid/record/hash.rb
|
208
207
|
- lib/active_uxid/record/ulid.rb
|
209
208
|
- lib/active_uxid/settings.rb
|
data/lib/active_uxid/record.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActiveUxid
|
4
|
-
module Record
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
# rubocop:disable Metrics/LineLength
|
10
|
-
ActiveUxid::Record.include(ActiveUxid::Record::Hash) if ActiveUxid::Settings.config.encoder_type == 'hash'
|
11
|
-
ActiveUxid::Record.include(ActiveUxid::Record::Ulid) if ActiveUxid::Settings.config.encoder_type == 'ulid'
|
12
|
-
# rubocop:enable Metrics/LineLength
|