active_uxid 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: afa254c4b663a4cb7ca45b05404c33d2c339d259
4
- data.tar.gz: ed19e20050e2894efc1730486d43c3c31ae053d1
3
+ metadata.gz: 7c9e877324685040eaccc2853d70c73ebd63cf4f
4
+ data.tar.gz: 37746f142994446134fd083d2afa48b1e5801b2c
5
5
  SHA512:
6
- metadata.gz: 3f7393d7c9d49fc3124a612497115d75f70fa802ce95f7b03bd5f5e5be150a64c3116f215f57e256b4c90123e315da5f4f972ead10b99265199057bc2da9e688
7
- data.tar.gz: cd45f3d5d087fef2ad244a4ce588dbf3e7ae77adb6f15dfd8c8657469070b6c67c32613b2f41e3ba4a9baea52df298dfadbc83804edafaa27c9c09a13e5cfe56
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[hash ulid].each do |file_name|
4
- require "active_uxid/record/#{file_name}"
3
+ %w[version settings].each do |file_name|
4
+ require "active_uxid/#{file_name}"
5
5
  end
6
6
 
7
- %w[version settings base hash ulid record].each do |file_name|
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
 
@@ -6,7 +6,6 @@ module ActiveUxid
6
6
  class Settings
7
7
  extend Dry::Configurable
8
8
 
9
- setting :encoder_type, 'ulid'
10
9
  setting :encoding_chars, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
11
10
  setting :encoding_length, 26
12
11
  setting :encoding_salt, 1369136
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRegulation
4
- VERSION ||= '1.0.2'
4
+ VERSION ||= '1.0.3'
5
5
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  ActiveUxid::Settings.configure do |config|
4
- config.encoder_type = 'ulid'
5
4
  config.encoding_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
6
5
  config.encoding_length = 26
7
6
  config.encoding_salt = 1369136
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.2
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
@@ -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