ulid-rails 0.6.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +10 -6
- data/.github/workflows/test.yml +19 -14
- data/.rubocop.yml +12 -0
- data/CHANGELOG.md +21 -6
- data/Gemfile +0 -7
- data/README.md +55 -14
- data/gemfiles/5.0.gemfile +7 -3
- data/gemfiles/5.1.gemfile +7 -3
- data/gemfiles/5.2.gemfile +8 -6
- data/gemfiles/6.0.gemfile +8 -6
- data/gemfiles/6.1.gemfile +5 -3
- data/gemfiles/7.0.gemfile +10 -0
- data/lib/ulid/rails/patch.rb +40 -0
- data/lib/ulid/rails/type.rb +3 -22
- data/lib/ulid/rails/version.rb +1 -1
- data/lib/ulid/rails.rb +11 -8
- data/ulid-rails.gemspec +14 -4
- metadata +34 -16
- data/gemfiles/4.2.gemfile +0 -6
- data/lib/ulid/rails/constants.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f122ca0476d8b8c06f1f4bf08219bdf653d0ba890a3cdb6d9d5d99dfec353424
|
4
|
+
data.tar.gz: 0d1d58ea8a26637db28421610971049cbc9730201c39f9d9444757a65a249a4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c37272d98ec13e144f2aa8c704d3db3140bf672cf3f6d7e76931acc7ab008b0a51cc91a51c402a8dbc14d73da3ce31092ace18e99efcf31b9ad4ff4c5fd6cb16
|
7
|
+
data.tar.gz: d7bcabb538e9f4a588b7d28b79459c06e44c9bfaeffdcaf5e563823908cdad5bcf7de3cd9fd2da20b21062415686e40f5df0904b53e38b9ac367084021616a19
|
data/.github/workflows/lint.yml
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
---
|
2
2
|
name: Linting
|
3
|
-
|
3
|
+
|
4
|
+
on:
|
5
|
+
pull_request:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
|
4
10
|
jobs:
|
5
11
|
standardrb:
|
6
|
-
env:
|
7
|
-
AR_VERSION: "5.2"
|
8
12
|
runs-on: ubuntu-latest
|
9
13
|
steps:
|
10
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v3
|
11
15
|
- uses: ruby/setup-ruby@v1
|
12
16
|
with:
|
13
|
-
ruby-version: 3.
|
17
|
+
ruby-version: "3.1"
|
14
18
|
bundler-cache: true
|
15
|
-
- run: bundle exec
|
19
|
+
- run: bundle exec rubocop
|
data/.github/workflows/test.yml
CHANGED
@@ -1,25 +1,30 @@
|
|
1
1
|
---
|
2
2
|
name: Tests
|
3
|
-
|
3
|
+
|
4
|
+
on:
|
5
|
+
pull_request:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
|
4
10
|
jobs:
|
5
11
|
tests:
|
6
12
|
runs-on: ubuntu-latest
|
7
13
|
strategy:
|
14
|
+
fail-fast: false
|
8
15
|
matrix:
|
9
|
-
activerecord-version: ["5.0", "5.1", "
|
10
|
-
ruby-version: ["2.6", "2.7", "3.0"]
|
16
|
+
activerecord-version: ["5.0", "5.1", "5.2", "6.0", "6.1", "7.0"]
|
17
|
+
ruby-version: ["2.6", "2.7", "3.0", "3.1"]
|
11
18
|
exclude:
|
12
|
-
- activerecord-version: "
|
13
|
-
|
14
|
-
- activerecord-version: "
|
15
|
-
|
16
|
-
- activerecord-version: "5.0"
|
17
|
-
|
18
|
-
- activerecord-version: "
|
19
|
-
|
20
|
-
- activerecord-version: "5.2"
|
21
|
-
ruby-version: "3.0"
|
19
|
+
- {activerecord-version: "5.0", ruby-version: "3.0"}
|
20
|
+
- {activerecord-version: "5.0", ruby-version: "3.1"}
|
21
|
+
- {activerecord-version: "5.1", ruby-version: "3.0"}
|
22
|
+
- {activerecord-version: "5.1", ruby-version: "3.1"}
|
23
|
+
- {activerecord-version: "5.2", ruby-version: "3.0"}
|
24
|
+
- {activerecord-version: "5.2", ruby-version: "3.1"}
|
25
|
+
- {activerecord-version: "6.0", ruby-version: "3.1"}
|
26
|
+
- {activerecord-version: "7.0", ruby-version: "2.6"}
|
22
27
|
steps:
|
23
|
-
- uses: actions/checkout@
|
28
|
+
- uses: actions/checkout@v3
|
24
29
|
- name: Test ActiveRecord ${{ matrix.activerecord-version }} and Ruby ${{ matrix.ruby-version }}
|
25
30
|
run: RUBY_VERSION=${{ matrix.ruby-version }} docker-compose run -e AR_VERSION=${{ matrix.activerecord-version }} test
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,24 +1,39 @@
|
|
1
1
|
# ulid-rails CHANGELOG
|
2
2
|
|
3
|
-
## 0
|
3
|
+
## 1.1.0
|
4
4
|
|
5
|
-
|
5
|
+
- Fix eager loading with limit/offset on models that have ulid primary key. The fix only applies to ActiveRecord 5.2, 6 and 7 (#38).
|
6
|
+
- Add support for Ruby 3.1.
|
7
|
+
- Add support for ActiveRecord 7.
|
6
8
|
|
7
|
-
## 0.
|
9
|
+
## 1.0.0
|
10
|
+
|
11
|
+
- Drop support for Rails 4.2.
|
12
|
+
|
13
|
+
### Breaking Changes
|
14
|
+
|
15
|
+
- `primary_key` option has been removed. You need to specify `auto_generate: true` to automatically fill your primary key columns.
|
16
|
+
|
17
|
+
## 0.6.0
|
18
|
+
|
19
|
+
- Add support for Rails 4.2, 5.0 and 5.1.
|
20
|
+
- Known Issue: AREL expressions incorrectly serialize ULID values in Rails 4.2 (#27).
|
21
|
+
|
22
|
+
## 0.5.0
|
8
23
|
|
9
24
|
- Ensure ULID order respects timestamp order to millisecond precision.
|
10
25
|
- Validation of ULID format when setting value. A wrong format value will trigger a `ULID::Rails::ArgumentError`.
|
11
26
|
|
12
|
-
## 0.4
|
27
|
+
## 0.4.0
|
13
28
|
|
14
29
|
- Support old ruby versions
|
15
30
|
- Fix auto_generate #2
|
16
31
|
|
17
|
-
## 0.3
|
32
|
+
## 0.3.0
|
18
33
|
|
19
34
|
- Support PostgresQL
|
20
35
|
|
21
|
-
## 0.2
|
36
|
+
## 0.2.0
|
22
37
|
|
23
38
|
### Breaking Changes
|
24
39
|
|
data/Gemfile
CHANGED
@@ -1,9 +1,2 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in ulid-rails.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
1
|
version = ENV["AR_VERSION"] || "6.0"
|
9
2
|
eval_gemfile File.expand_path("../gemfiles/#{version}.gemfile", __FILE__)
|
data/README.md
CHANGED
@@ -1,25 +1,29 @@
|
|
1
1
|
# ULID::Rails
|
2
2
|
|
3
|
-
This gem makes it possible to use [ULID](https://github.com/ulid/spec) for DB
|
4
|
-
|
3
|
+
This gem makes it possible to use [ULID](https://github.com/ulid/spec) for DB in a Ruby on Rails app.
|
5
4
|
|
6
5
|
## Installation
|
7
6
|
|
8
|
-
|
9
7
|
```ruby
|
10
8
|
gem 'ulid-rails'
|
11
9
|
```
|
12
10
|
|
13
11
|
And then execute:
|
14
12
|
|
15
|
-
|
13
|
+
```
|
14
|
+
$ bundle
|
15
|
+
```
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
19
|
-
|
19
|
+
```
|
20
|
+
$ gem install ulid-rails
|
21
|
+
```
|
20
22
|
|
21
23
|
## Usage
|
22
24
|
|
25
|
+
First, load up the gem with `require 'ulid/rails'`.
|
26
|
+
|
23
27
|
### Migrations
|
24
28
|
|
25
29
|
Specify `id: false` to `create_table` and add `id` column as 16-byte binary type.
|
@@ -27,13 +31,12 @@ Specify `id: false` to `create_table` and add `id` column as 16-byte binary type
|
|
27
31
|
```ruby
|
28
32
|
def change
|
29
33
|
create_table :users, id: false do |t|
|
30
|
-
t.binary :id, limit: 16,
|
34
|
+
t.binary :id, limit: 16, auto_generate: true
|
31
35
|
# ...
|
32
36
|
end
|
33
37
|
end
|
34
38
|
```
|
35
39
|
|
36
|
-
|
37
40
|
### Model Changes
|
38
41
|
|
39
42
|
Just add the below lines to your models.
|
@@ -41,7 +44,7 @@ Just add the below lines to your models.
|
|
41
44
|
```ruby
|
42
45
|
class MyModel < ApplicationRecord
|
43
46
|
include ULID::Rails
|
44
|
-
ulid :id,
|
47
|
+
ulid :id, auto_generate: true # The first argument is the ULID column name
|
45
48
|
end
|
46
49
|
```
|
47
50
|
|
@@ -53,7 +56,7 @@ Since ULID includes milli seconds precision timestamp, you don't need to store `
|
|
53
56
|
```ruby
|
54
57
|
class MyModel < ApplicationRecord
|
55
58
|
include ULID::Rails
|
56
|
-
ulid :id,
|
59
|
+
ulid :id, auto_generate: true # The first argument is the ULID column name
|
57
60
|
|
58
61
|
# defines `created_at` method which extract timestamp value from id column.
|
59
62
|
# This way you don't need physical `created_at` column.
|
@@ -72,7 +75,7 @@ A virtual column is useful if you want to add index on the timestamp column or w
|
|
72
75
|
|
73
76
|
```ruby
|
74
77
|
create_table :users, id: false do |t|
|
75
|
-
t.binary :id, limit: 16,
|
78
|
+
t.binary :id, limit: 16, auto_generate: true
|
76
79
|
t.datetime :updated_at
|
77
80
|
t.virtual_ulid_timestamp :created_at, :id
|
78
81
|
end
|
@@ -82,14 +85,13 @@ end
|
|
82
85
|
|
83
86
|
### Auto-generate ULID
|
84
87
|
|
85
|
-
If `
|
86
|
-
|
88
|
+
If `auto_generate` is `true`, ULID is auto-generated before create by default.
|
89
|
+
If not specified, the default is `false`.
|
87
90
|
|
88
91
|
```
|
89
92
|
class Model < ApplicationRecord
|
90
|
-
ulid :id,
|
93
|
+
ulid :id, auto_generate: true # auto-generate enabled
|
91
94
|
ulid :foreign_key # auto-generate disabled
|
92
|
-
ulid :ulid, auto_generate: true # non primary, auto-generate enabled
|
93
95
|
end
|
94
96
|
```
|
95
97
|
|
@@ -104,6 +106,41 @@ You need to specicfy `type` option
|
|
104
106
|
end
|
105
107
|
```
|
106
108
|
|
109
|
+
### Many to many associations
|
110
|
+
|
111
|
+
Please note that this library doesn't work properly with `has_and_belongs_to_many` associations.
|
112
|
+
|
113
|
+
Our recommendation is to be explicit and instead use the `has_many, through: join_class` association.
|
114
|
+
Notice that for it to work properly you must specify the `has_many` to the join class in the main classes of the association,
|
115
|
+
and your join class must have `belongs_to` main classes defined as shown in the example below:
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
class User < ActiveRecord::Base
|
119
|
+
include ULID::Rails
|
120
|
+
ulid :id, auto_generate: true
|
121
|
+
|
122
|
+
has_many :user_articles
|
123
|
+
has_many :articles, through: :user_articles
|
124
|
+
end
|
125
|
+
|
126
|
+
class UserArticle < ActiveRecord::Base
|
127
|
+
include ULID::Rails
|
128
|
+
ulid :id, auto_generate: true
|
129
|
+
ulid :user_id
|
130
|
+
ulid :article_id
|
131
|
+
|
132
|
+
belongs_to :user
|
133
|
+
belongs_to :article
|
134
|
+
end
|
135
|
+
|
136
|
+
class Article < ActiveRecord::Base
|
137
|
+
include ULID::Rails
|
138
|
+
ulid :id, auto_generate: true
|
139
|
+
|
140
|
+
has_many :user_articles
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
107
144
|
## Development
|
108
145
|
|
109
146
|
### Run tests
|
@@ -126,6 +163,10 @@ Or run tests locally, without docker-compose
|
|
126
163
|
$ AR_VERSION=4.2 bundle update && AR_VERSION=4.2 bundle exec rake test
|
127
164
|
```
|
128
165
|
|
166
|
+
## Known issues
|
167
|
+
|
168
|
+
- ActiveRecord 5.0 and 5.1 do not work properly with some data association loading methods. For example, eager loading with limit/offset on a model that has a ulid ID. Refer to test cases that are skiped for AR 5.0 and 5.1.
|
169
|
+
|
129
170
|
## License
|
130
171
|
|
131
172
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/gemfiles/5.0.gemfile
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec path: ".."
|
4
|
+
|
5
|
+
gem "activesupport", "~> 5.0.0"
|
6
|
+
gem "activemodel", "~> 5.0.0"
|
7
|
+
gem "activerecord", "~> 5.0.0"
|
4
8
|
gem "sqlite3", "~> 1.3.6"
|
5
9
|
gem "mysql2", ">= 0.3.18", "< 0.6.0"
|
6
10
|
gem "pg", ">= 0.18", "< 2.0"
|
data/gemfiles/5.1.gemfile
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec path: ".."
|
4
|
+
|
5
|
+
gem "activesupport", "~> 5.1.0"
|
6
|
+
gem "activemodel", "~> 5.1.0"
|
7
|
+
gem "activerecord", "~> 5.1.0"
|
4
8
|
gem "sqlite3", "~> 1.3", ">= 1.3.6"
|
5
9
|
gem "mysql2", ">= 0.3.18", "< 0.6.0"
|
6
10
|
gem "pg", ">= 0.18", "< 2.0"
|
data/gemfiles/5.2.gemfile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
gem "
|
6
|
-
gem "
|
7
|
-
gem "
|
8
|
-
gem "
|
3
|
+
gemspec path: ".."
|
4
|
+
|
5
|
+
gem "activesupport", "~> 5.2.0"
|
6
|
+
gem "activemodel", "~> 5.2.0"
|
7
|
+
gem "activerecord", "~> 5.2.0"
|
8
|
+
gem "sqlite3", "~> 1.3", ">= 1.3.6"
|
9
|
+
gem "mysql2", ">= 0.4.4", "< 0.6.0"
|
10
|
+
gem "pg", ">= 0.18", "< 2.0"
|
data/gemfiles/6.0.gemfile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
gem "
|
6
|
-
gem "
|
7
|
-
gem "
|
8
|
-
gem "
|
3
|
+
gemspec path: ".."
|
4
|
+
|
5
|
+
gem "activesupport", "~> 6.0.0"
|
6
|
+
gem "activemodel", "~> 6.0.0"
|
7
|
+
gem "activerecord", "~> 6.0.0"
|
8
|
+
gem "sqlite3", "~> 1.4"
|
9
|
+
gem "mysql2", ">= 0.4.4"
|
10
|
+
gem "pg", ">= 0.18", "< 2.0"
|
data/gemfiles/6.1.gemfile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
+
gemspec path: ".."
|
4
|
+
|
3
5
|
gem "activesupport", "~> 6.1.0"
|
4
6
|
gem "activemodel", "~> 6.1.0"
|
5
7
|
gem "activerecord", "~> 6.1.0"
|
6
|
-
gem "sqlite3", "~> 1.4
|
7
|
-
gem "mysql2"
|
8
|
-
gem "pg"
|
8
|
+
gem "sqlite3", "~> 1.4"
|
9
|
+
gem "mysql2", "~> 0.5"
|
10
|
+
gem "pg", "~> 1.1"
|
data/lib/ulid/rails/patch.rb
CHANGED
@@ -8,6 +8,46 @@ module ULID
|
|
8
8
|
as: "FROM_UNIXTIME(CONV(HEX(#{ulid_column_name} >> 80), 16, 10) / 1000.0)"
|
9
9
|
end
|
10
10
|
end
|
11
|
+
|
12
|
+
module FinderMethods
|
13
|
+
def limited_ids_for(relation)
|
14
|
+
id_rows = super
|
15
|
+
if klass.attribute_types[primary_key].is_a? ULID::Rails::Type
|
16
|
+
id_rows.map do |id|
|
17
|
+
klass.attribute_types[primary_key].deserialize id
|
18
|
+
end
|
19
|
+
else
|
20
|
+
id_rows
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
module SchemaStatements
|
26
|
+
def distinct_relation_for_primary_key(relation) # :nodoc:
|
27
|
+
values = columns_for_distinct(
|
28
|
+
visitor.compile(relation.table[relation.primary_key]),
|
29
|
+
relation.order_values
|
30
|
+
)
|
31
|
+
|
32
|
+
limited = relation.reselect(values).distinct!
|
33
|
+
limited_ids = select_rows(limited.arel, "SQL").map(&:last)
|
34
|
+
|
35
|
+
if relation.klass.attribute_types[relation.primary_key].is_a? ULID::Rails::Type
|
36
|
+
limited_ids.map! do |id|
|
37
|
+
relation.klass.attribute_types[relation.primary_key].deserialize id
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
if limited_ids.empty?
|
42
|
+
relation.none!
|
43
|
+
else
|
44
|
+
relation.where!(relation.primary_key => limited_ids)
|
45
|
+
end
|
46
|
+
|
47
|
+
relation.limit_value = relation.offset_value = nil
|
48
|
+
relation
|
49
|
+
end
|
50
|
+
end
|
11
51
|
end
|
12
52
|
end
|
13
53
|
end
|
data/lib/ulid/rails/type.rb
CHANGED
@@ -1,21 +1,12 @@
|
|
1
|
+
require "active_model/type"
|
1
2
|
require "ulid/rails/formatter"
|
2
3
|
require "ulid/rails/validator"
|
3
4
|
require "ulid/rails/errors"
|
4
|
-
require "ulid/rails/constants"
|
5
5
|
|
6
6
|
module ULID
|
7
7
|
module Rails
|
8
|
-
|
9
|
-
|
10
|
-
require "active_record/type"
|
11
|
-
Binary = ActiveRecord::Type::Binary
|
12
|
-
else
|
13
|
-
require "active_model/type"
|
14
|
-
Binary = ActiveModel::Type::Binary
|
15
|
-
end
|
16
|
-
|
17
|
-
class Type < Binary
|
18
|
-
class Data < Binary::Data
|
8
|
+
class Type < ActiveModel::Type::Binary
|
9
|
+
class Data < ActiveModel::Type::Binary::Data
|
19
10
|
alias_method :hex, :to_s
|
20
11
|
end
|
21
12
|
|
@@ -50,16 +41,6 @@ module ULID
|
|
50
41
|
end
|
51
42
|
end
|
52
43
|
|
53
|
-
if RAILS_4_2
|
54
|
-
alias_method :type_cast_for_database, :serialize
|
55
|
-
alias_method :type_cast_from_database, :deserialize
|
56
|
-
|
57
|
-
def type_cast_from_user(value)
|
58
|
-
assert_valid_value(value)
|
59
|
-
super
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
44
|
private
|
64
45
|
|
65
46
|
def adapter
|
data/lib/ulid/rails/version.rb
CHANGED
data/lib/ulid/rails.rb
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
require "active_record"
|
2
2
|
require "active_support/concern"
|
3
|
+
require "active_model/type"
|
3
4
|
require "ulid"
|
4
5
|
require "base32/crockford"
|
5
6
|
require "ulid/rails/version"
|
6
7
|
require "ulid/rails/type"
|
7
8
|
require "ulid/rails/patch"
|
8
|
-
require "ulid/rails/constants"
|
9
9
|
|
10
10
|
module ULID
|
11
11
|
module Rails
|
12
12
|
extend ActiveSupport::Concern
|
13
13
|
|
14
14
|
class_methods do
|
15
|
-
def ulid(column_name,
|
15
|
+
def ulid(column_name, auto_generate: false)
|
16
16
|
attribute column_name, ULID::Rails::Type.new
|
17
17
|
|
18
|
-
auto_generate = primary_key || auto_generate
|
19
18
|
if auto_generate
|
20
19
|
before_create do
|
21
20
|
send("#{column_name}=", ULID.generate) if send(column_name).nil?
|
@@ -45,11 +44,15 @@ module ULID
|
|
45
44
|
end
|
46
45
|
end
|
47
46
|
|
48
|
-
|
49
|
-
require "active_model/type"
|
50
|
-
ActiveModel::Type.register(:ulid, ULID::Rails::Type)
|
51
|
-
end
|
52
|
-
|
47
|
+
ActiveModel::Type.register(:ulid, ULID::Rails::Type)
|
53
48
|
ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Patch::Migrations
|
49
|
+
case ActiveRecord::VERSION::MAJOR
|
50
|
+
when 5
|
51
|
+
ActiveRecord::FinderMethods.prepend(Patch::FinderMethods) unless ActiveRecord::VERSION::MINOR < 2
|
52
|
+
when 6
|
53
|
+
ActiveRecord::FinderMethods.prepend(Patch::FinderMethods)
|
54
|
+
when 7
|
55
|
+
ActiveRecord::ConnectionAdapters::SchemaStatements.prepend(Patch::SchemaStatements)
|
56
|
+
end
|
54
57
|
end
|
55
58
|
end
|
data/ulid-rails.gemspec
CHANGED
@@ -5,13 +5,22 @@ require "ulid/rails/version"
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "ulid-rails"
|
7
7
|
spec.version = ULID::Rails::VERSION
|
8
|
+
spec.required_ruby_version = ">= 2.5.0"
|
8
9
|
spec.authors = ["Kazunori Kajihiro", "Zendesk"]
|
9
10
|
spec.email = ["kazunori.kajihiro@gmail.com", "ruby-core@zendesk.com"]
|
10
11
|
|
11
12
|
spec.summary = "ULID for rails"
|
12
13
|
spec.description = "ULID for rails"
|
14
|
+
spec.homepage = "https://github.com/k2nr/ulid-rails/"
|
13
15
|
spec.license = "MIT"
|
14
16
|
|
17
|
+
spec.metadata = {
|
18
|
+
"changelog_uri" => "https://github.com/k2nr/ulid-rails/blob/master/CHANGELOG.md",
|
19
|
+
"source_code_uri" => "https://github.com/k2nr/ulid-rails/",
|
20
|
+
"bug_tracker_uri" => "https://github.com/k2nr/ulid-rails/issues",
|
21
|
+
"rubygems_mfa_required" => "true"
|
22
|
+
}
|
23
|
+
|
15
24
|
# Specify which files should be added to the gem when it is released.
|
16
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
26
|
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
@@ -23,11 +32,12 @@ Gem::Specification.new do |spec|
|
|
23
32
|
|
24
33
|
spec.add_dependency "ulid", "~> 1.0"
|
25
34
|
spec.add_dependency "base32-crockford", "~> 0.1"
|
26
|
-
spec.add_dependency "activesupport", ">=
|
27
|
-
spec.add_dependency "activemodel", ">=
|
28
|
-
spec.add_dependency "activerecord", ">=
|
35
|
+
spec.add_dependency "activesupport", ">= 5.0"
|
36
|
+
spec.add_dependency "activemodel", ">= 5.0"
|
37
|
+
spec.add_dependency "activerecord", ">= 5.0"
|
29
38
|
spec.add_development_dependency "bundler"
|
30
39
|
spec.add_development_dependency "rake"
|
31
40
|
spec.add_development_dependency "minitest", "~> 5.0"
|
32
|
-
spec.add_development_dependency "
|
41
|
+
spec.add_development_dependency "rubocop-minitest"
|
42
|
+
spec.add_development_dependency "standard", "~> 1.16.0"
|
33
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ulid-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazunori Kajihiro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ulid
|
@@ -45,42 +45,42 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '5.0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '5.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activemodel
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '5.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '5.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: activerecord
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '5.0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '5.0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,20 +123,34 @@ dependencies:
|
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '5.0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-minitest
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: standard
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
144
|
- - "~>"
|
131
145
|
- !ruby/object:Gem::Version
|
132
|
-
version: 1.
|
146
|
+
version: 1.16.0
|
133
147
|
type: :development
|
134
148
|
prerelease: false
|
135
149
|
version_requirements: !ruby/object:Gem::Requirement
|
136
150
|
requirements:
|
137
151
|
- - "~>"
|
138
152
|
- !ruby/object:Gem::Version
|
139
|
-
version: 1.
|
153
|
+
version: 1.16.0
|
140
154
|
description: ULID for rails
|
141
155
|
email:
|
142
156
|
- kazunori.kajihiro@gmail.com
|
@@ -149,6 +163,7 @@ files:
|
|
149
163
|
- ".github/workflows/lint.yml"
|
150
164
|
- ".github/workflows/test.yml"
|
151
165
|
- ".gitignore"
|
166
|
+
- ".rubocop.yml"
|
152
167
|
- ".standard.yml"
|
153
168
|
- CHANGELOG.md
|
154
169
|
- Gemfile
|
@@ -159,14 +174,13 @@ files:
|
|
159
174
|
- bin/run_tests
|
160
175
|
- bin/setup
|
161
176
|
- docker-compose.yml
|
162
|
-
- gemfiles/4.2.gemfile
|
163
177
|
- gemfiles/5.0.gemfile
|
164
178
|
- gemfiles/5.1.gemfile
|
165
179
|
- gemfiles/5.2.gemfile
|
166
180
|
- gemfiles/6.0.gemfile
|
167
181
|
- gemfiles/6.1.gemfile
|
182
|
+
- gemfiles/7.0.gemfile
|
168
183
|
- lib/ulid/rails.rb
|
169
|
-
- lib/ulid/rails/constants.rb
|
170
184
|
- lib/ulid/rails/errors.rb
|
171
185
|
- lib/ulid/rails/formatter.rb
|
172
186
|
- lib/ulid/rails/patch.rb
|
@@ -174,10 +188,14 @@ files:
|
|
174
188
|
- lib/ulid/rails/validator.rb
|
175
189
|
- lib/ulid/rails/version.rb
|
176
190
|
- ulid-rails.gemspec
|
177
|
-
homepage:
|
191
|
+
homepage: https://github.com/k2nr/ulid-rails/
|
178
192
|
licenses:
|
179
193
|
- MIT
|
180
|
-
metadata:
|
194
|
+
metadata:
|
195
|
+
changelog_uri: https://github.com/k2nr/ulid-rails/blob/master/CHANGELOG.md
|
196
|
+
source_code_uri: https://github.com/k2nr/ulid-rails/
|
197
|
+
bug_tracker_uri: https://github.com/k2nr/ulid-rails/issues
|
198
|
+
rubygems_mfa_required: 'true'
|
181
199
|
post_install_message:
|
182
200
|
rdoc_options: []
|
183
201
|
require_paths:
|
@@ -186,14 +204,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
204
|
requirements:
|
187
205
|
- - ">="
|
188
206
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
207
|
+
version: 2.5.0
|
190
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
209
|
requirements:
|
192
210
|
- - ">="
|
193
211
|
- !ruby/object:Gem::Version
|
194
212
|
version: '0'
|
195
213
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.1.6
|
197
215
|
signing_key:
|
198
216
|
specification_version: 4
|
199
217
|
summary: ULID for rails
|
data/gemfiles/4.2.gemfile
DELETED