mysql-binuuid-rails 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of mysql-binuuid-rails might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +8 -8
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +78 -69
- data/README.md +67 -0
- data/lib/mysql-binuuid/version.rb +1 -1
- data/mysql-binuuid-rails.gemspec +2 -2
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e816b78ae0f3deafefbbbe31a8afd9b2fb3871666ff726743d3a5e73c041d908
|
4
|
+
data.tar.gz: e616712f16e6560b0f6588081d641d7f6fa058f5b3ffd4b122f3d71374048529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6765b2da70182aeb6aa1066d63d609056ecafea9d6fbaecd2249a43d693b8c573c8833f0e1609449903d1d4f14d7386e9df86bd0cc4fbf7cbd72dd17c894d9dc
|
7
|
+
data.tar.gz: 4cd1ff1cd8528da16c662eff37d65e1c7327dcd18f5486d037824f2c4eaf31793b24963fe86f3faf8cc0a07c6e6219bed4876a13a0378c0177fae9445d46001c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1
|
data/.travis.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
4
|
+
- 2.3.7
|
5
|
+
- 2.4.4
|
6
|
+
- 2.5.1
|
7
7
|
env:
|
8
8
|
matrix:
|
9
|
-
- RAILS_VERSION=5.0.
|
10
|
-
- RAILS_VERSION=5.1.
|
11
|
-
- RAILS_VERSION=5.
|
12
|
-
- RAILS_VERSION=5.1.2
|
9
|
+
- RAILS_VERSION=5.0.5
|
10
|
+
- RAILS_VERSION=5.1.6
|
11
|
+
- RAILS_VERSION=5.2.0
|
13
12
|
before_install:
|
13
|
+
- gem install bundler
|
14
14
|
- gem update bundler
|
15
|
-
- bundle update
|
15
|
+
- bundle update
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,113 +1,122 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mysql-binuuid-rails (
|
4
|
+
mysql-binuuid-rails (1.0.0)
|
5
5
|
rails (>= 5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.
|
11
|
-
actionpack (= 5.
|
10
|
+
actioncable (5.2.0)
|
11
|
+
actionpack (= 5.2.0)
|
12
12
|
nio4r (~> 2.0)
|
13
|
-
websocket-driver (
|
14
|
-
actionmailer (5.
|
15
|
-
actionpack (= 5.
|
16
|
-
actionview (= 5.
|
17
|
-
activejob (= 5.
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.0)
|
15
|
+
actionpack (= 5.2.0)
|
16
|
+
actionview (= 5.2.0)
|
17
|
+
activejob (= 5.2.0)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.
|
21
|
-
actionview (= 5.
|
22
|
-
activesupport (= 5.
|
20
|
+
actionpack (5.2.0)
|
21
|
+
actionview (= 5.2.0)
|
22
|
+
activesupport (= 5.2.0)
|
23
23
|
rack (~> 2.0)
|
24
|
-
rack-test (
|
24
|
+
rack-test (>= 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.
|
28
|
-
activesupport (= 5.
|
27
|
+
actionview (5.2.0)
|
28
|
+
activesupport (= 5.2.0)
|
29
29
|
builder (~> 3.1)
|
30
30
|
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.
|
34
|
-
activesupport (= 5.
|
33
|
+
activejob (5.2.0)
|
34
|
+
activesupport (= 5.2.0)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.
|
37
|
-
activesupport (= 5.
|
38
|
-
activerecord (5.
|
39
|
-
activemodel (= 5.
|
40
|
-
activesupport (= 5.
|
41
|
-
arel (
|
42
|
-
|
36
|
+
activemodel (5.2.0)
|
37
|
+
activesupport (= 5.2.0)
|
38
|
+
activerecord (5.2.0)
|
39
|
+
activemodel (= 5.2.0)
|
40
|
+
activesupport (= 5.2.0)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.0)
|
43
|
+
actionpack (= 5.2.0)
|
44
|
+
activerecord (= 5.2.0)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.0)
|
43
47
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
|
-
i18n (
|
48
|
+
i18n (>= 0.7, < 2)
|
45
49
|
minitest (~> 5.1)
|
46
50
|
tzinfo (~> 1.1)
|
47
|
-
arel (
|
51
|
+
arel (9.0.0)
|
48
52
|
builder (3.2.3)
|
49
53
|
concurrent-ruby (1.0.5)
|
50
|
-
|
51
|
-
|
54
|
+
crass (1.0.4)
|
55
|
+
erubi (1.7.1)
|
56
|
+
globalid (0.4.1)
|
52
57
|
activesupport (>= 4.2.0)
|
53
|
-
i18n (0.
|
54
|
-
|
58
|
+
i18n (1.0.0)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
loofah (2.2.2)
|
61
|
+
crass (~> 1.0.2)
|
55
62
|
nokogiri (>= 1.5.9)
|
56
|
-
mail (2.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
minitest
|
63
|
+
mail (2.7.0)
|
64
|
+
mini_mime (>= 0.1.1)
|
65
|
+
marcel (0.3.2)
|
66
|
+
mimemagic (~> 0.3.2)
|
67
|
+
method_source (0.9.0)
|
68
|
+
mimemagic (0.3.2)
|
69
|
+
mini_mime (1.0.0)
|
70
|
+
mini_portile2 (2.3.0)
|
71
|
+
minitest (5.11.3)
|
72
|
+
minitest-hooks (1.4.2)
|
65
73
|
minitest-spec-context (0.0.3)
|
66
|
-
mysql2 (0.4.
|
67
|
-
nio4r (2.
|
68
|
-
nokogiri (1.8.
|
69
|
-
mini_portile2 (~> 2.
|
70
|
-
rack (2.0.
|
71
|
-
rack-test (0.
|
72
|
-
rack (>= 1.0)
|
73
|
-
rails (5.
|
74
|
-
actioncable (= 5.
|
75
|
-
actionmailer (= 5.
|
76
|
-
actionpack (= 5.
|
77
|
-
actionview (= 5.
|
78
|
-
activejob (= 5.
|
79
|
-
activemodel (= 5.
|
80
|
-
activerecord (= 5.
|
81
|
-
|
82
|
-
|
83
|
-
|
74
|
+
mysql2 (0.4.10)
|
75
|
+
nio4r (2.3.0)
|
76
|
+
nokogiri (1.8.2)
|
77
|
+
mini_portile2 (~> 2.3.0)
|
78
|
+
rack (2.0.4)
|
79
|
+
rack-test (1.0.0)
|
80
|
+
rack (>= 1.0, < 3)
|
81
|
+
rails (5.2.0)
|
82
|
+
actioncable (= 5.2.0)
|
83
|
+
actionmailer (= 5.2.0)
|
84
|
+
actionpack (= 5.2.0)
|
85
|
+
actionview (= 5.2.0)
|
86
|
+
activejob (= 5.2.0)
|
87
|
+
activemodel (= 5.2.0)
|
88
|
+
activerecord (= 5.2.0)
|
89
|
+
activestorage (= 5.2.0)
|
90
|
+
activesupport (= 5.2.0)
|
91
|
+
bundler (>= 1.3.0)
|
92
|
+
railties (= 5.2.0)
|
84
93
|
sprockets-rails (>= 2.0.0)
|
85
94
|
rails-dom-testing (2.0.3)
|
86
95
|
activesupport (>= 4.2.0)
|
87
96
|
nokogiri (>= 1.6)
|
88
|
-
rails-html-sanitizer (1.0.
|
89
|
-
loofah (~> 2.
|
90
|
-
railties (5.
|
91
|
-
actionpack (= 5.
|
92
|
-
activesupport (= 5.
|
97
|
+
rails-html-sanitizer (1.0.4)
|
98
|
+
loofah (~> 2.2, >= 2.2.2)
|
99
|
+
railties (5.2.0)
|
100
|
+
actionpack (= 5.2.0)
|
101
|
+
activesupport (= 5.2.0)
|
93
102
|
method_source
|
94
103
|
rake (>= 0.8.7)
|
95
104
|
thor (>= 0.18.1, < 2.0)
|
96
|
-
rake (12.
|
105
|
+
rake (12.3.1)
|
97
106
|
sprockets (3.7.1)
|
98
107
|
concurrent-ruby (~> 1.0)
|
99
108
|
rack (> 1, < 3)
|
100
|
-
sprockets-rails (3.2.
|
109
|
+
sprockets-rails (3.2.1)
|
101
110
|
actionpack (>= 4.0)
|
102
111
|
activesupport (>= 4.0)
|
103
112
|
sprockets (>= 3.0.0)
|
104
|
-
thor (0.
|
113
|
+
thor (0.20.0)
|
105
114
|
thread_safe (0.3.6)
|
106
|
-
tzinfo (1.2.
|
115
|
+
tzinfo (1.2.5)
|
107
116
|
thread_safe (~> 0.1)
|
108
|
-
websocket-driver (0.
|
117
|
+
websocket-driver (0.7.0)
|
109
118
|
websocket-extensions (>= 0.1.0)
|
110
|
-
websocket-extensions (0.1.
|
119
|
+
websocket-extensions (0.1.3)
|
111
120
|
|
112
121
|
PLATFORMS
|
113
122
|
ruby
|
@@ -118,8 +127,8 @@ DEPENDENCIES
|
|
118
127
|
minitest-hooks
|
119
128
|
minitest-spec-context
|
120
129
|
mysql-binuuid-rails!
|
121
|
-
mysql2
|
130
|
+
mysql2 (< 0.5)
|
122
131
|
rake
|
123
132
|
|
124
133
|
BUNDLED WITH
|
125
|
-
1.
|
134
|
+
1.16.1
|
data/README.md
CHANGED
@@ -76,6 +76,73 @@ class Book < ApplicationRecord
|
|
76
76
|
end
|
77
77
|
```
|
78
78
|
|
79
|
+
# Migrating from ActiveUUID
|
80
|
+
|
81
|
+
There's a couple of things you need to take into consideration when you're
|
82
|
+
migrating from ActiveUUID to `mysql-binuuid-rails`.
|
83
|
+
|
84
|
+
## Replace `include ActiveUUID::UUID` in your models
|
85
|
+
|
86
|
+
In your models where you did `include ActiveUUID::UUID`, you now have to
|
87
|
+
specify the attribute which is a UUID instead:
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
class Book < ApplicationRecord
|
91
|
+
attribute :uuid, MySQLBinUUID::Type.new
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
|
96
|
+
## No `uuid` column in database migrations
|
97
|
+
|
98
|
+
ActiveUUID comes with a neat column type that you can use in migrations. Since
|
99
|
+
`mysql-binuuid-rails` does not, you will have to change all migrations in which
|
100
|
+
you leveraged on that migration column if you want your migrations to keep
|
101
|
+
working for new setups.
|
102
|
+
|
103
|
+
The idea behind *not* providing a `uuid` type for columnns in migrations is
|
104
|
+
that you are aware of what the actual type of the column is you're creating,
|
105
|
+
and that it is not hidden magic.
|
106
|
+
|
107
|
+
It's pretty simple:
|
108
|
+
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
# Anywhere where you did this in your migrations...
|
112
|
+
|
113
|
+
create_table :books do |t|
|
114
|
+
t.uuid :reference, ...
|
115
|
+
end
|
116
|
+
|
117
|
+
# ..you should change these kinds of lines into the kind described
|
118
|
+
# below. It's what ActiveUUID did for you, but what you now have
|
119
|
+
# to do yourself.
|
120
|
+
|
121
|
+
create_table :books do |t|
|
122
|
+
t.binary :reference, limit: 16, ...
|
123
|
+
end
|
124
|
+
```
|
125
|
+
|
126
|
+
## No UUIDTools
|
127
|
+
|
128
|
+
ActiveUUID comes with [UUIDTools](https://github.com/sporkmonger/uuidtools).
|
129
|
+
`mysql-binuuid-rails` does not. When you retrieve a UUID typed attribute from
|
130
|
+
a model when using ActiveUUID, the result is a `UUIDTools::UUID` object. When
|
131
|
+
you retrieve a UUID typed attribute from a model when using
|
132
|
+
`mysql-binuuid-rails`, you just get a `String` of 36 characters (it includes
|
133
|
+
the dashes).
|
134
|
+
|
135
|
+
Migrating shouldn't be that difficult though. `UUIDTools::UUID` implements
|
136
|
+
`#to_s`, which returns precisely the same as `mysql-binuuid-rails` returns
|
137
|
+
by default. But it's good to be aware of this in case you're running into
|
138
|
+
weirdness.
|
139
|
+
|
140
|
+
|
141
|
+
# Known issues
|
142
|
+
|
143
|
+
* With Rails 5.0 in combination with uniqueness validations, ActiveRecord generates a wrong query. The `x` in front of the queried value, which casts the value to the proper data type, is missing.
|
144
|
+
|
145
|
+
|
79
146
|
# Contributing
|
80
147
|
|
81
148
|
To start coding on `mysql-binuuid-rails`, fork the project, clone it locally
|
data/mysql-binuuid-rails.gemspec
CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |spec|
|
|
19
19
|
f.match(%r{^(test|spec|features)/})
|
20
20
|
end
|
21
21
|
|
22
|
-
spec.required_ruby_version = ">= 2.
|
22
|
+
spec.required_ruby_version = ">= 2.3"
|
23
23
|
|
24
24
|
spec.add_runtime_dependency "rails", ENV["RAILS_VERSION"] || ">= 5"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler"
|
27
27
|
spec.add_development_dependency "rake"
|
28
|
-
spec.add_development_dependency "mysql2"
|
28
|
+
spec.add_development_dependency "mysql2", "< 0.5"
|
29
29
|
spec.add_development_dependency "minitest"
|
30
30
|
spec.add_development_dependency "minitest-spec-context"
|
31
31
|
spec.add_development_dependency "minitest-hooks"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql-binuuid-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Oude Veldhuis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: mysql2
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "<"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "<"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- ".gitignore"
|
119
119
|
- ".ruby-version"
|
120
120
|
- ".travis.yml"
|
121
|
+
- CHANGELOG.md
|
121
122
|
- Gemfile
|
122
123
|
- Gemfile.lock
|
123
124
|
- LICENSE.txt
|
@@ -141,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
142
|
requirements:
|
142
143
|
- - ">="
|
143
144
|
- !ruby/object:Gem::Version
|
144
|
-
version: '2.
|
145
|
+
version: '2.3'
|
145
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
147
|
requirements:
|
147
148
|
- - ">="
|
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
152
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.6
|
153
|
+
rubygems_version: 2.7.6
|
153
154
|
signing_key:
|
154
155
|
specification_version: 4
|
155
156
|
summary: Let ActiveRecord serialize and cast your UUIDs to and from binary columns
|