activerecord-pg_enum 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/Appraisals +1 -1
- data/CHANGELOG.md +3 -0
- data/Gemfile +6 -0
- data/README.md +21 -2
- data/Rakefile +1 -0
- data/bin/setup +1 -1
- data/gemfiles/4.1.gemfile.lock +2 -2
- data/gemfiles/4.2.gemfile.lock +1 -1
- data/gemfiles/5.0.gemfile.lock +1 -1
- data/gemfiles/5.1.gemfile.lock +1 -1
- data/gemfiles/5.2.gemfile.lock +1 -1
- data/gemfiles/6.0.gemfile +1 -1
- data/gemfiles/6.0.gemfile.lock +10 -10
- data/gemfiles/edge.gemfile.lock +1 -1
- data/lib/active_record/pg_enum/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b1832aa7fd717d65aa994e1f6e66d7230199acde89ce3f773c624fd78e47edd
|
4
|
+
data.tar.gz: 6ebfdb25f6bc7b7cde05f1b1e7e15187d0636a1e286c97619ba38a379486eb1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1950b01db769d5bb6e2a939d48661df46ec5349e6a26f7831a7d09c03dc1b02bcface09fc3dadda128fb367b39cb44d1a45534735dc6ca3c6022f64ddf627c1f
|
7
|
+
data.tar.gz: 6fd8d5fdeba244ee8944929073806b7f9d1e3d719345c09a6fc556ae9e28b30221133ee38594d2eca5247f5c89d0f4e2277d90b99a817abeba9171a8315fe7f1
|
data/.travis.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
sudo: false
|
2
|
+
dist: xenial
|
2
3
|
language: ruby
|
3
4
|
matrix:
|
4
5
|
include:
|
@@ -18,10 +19,13 @@ matrix:
|
|
18
19
|
gemfile: gemfiles/edge.gemfile
|
19
20
|
allow_failures:
|
20
21
|
- gemfile: gemfiles/edge.gemfile
|
22
|
+
services:
|
23
|
+
- postgresql
|
21
24
|
addons:
|
22
|
-
postgresql: "9.
|
25
|
+
postgresql: "9.6"
|
23
26
|
before_install: gem install bundler -v 1.17.3
|
24
27
|
script: "bundle exec rake spec"
|
25
28
|
env:
|
26
29
|
global:
|
27
30
|
- TEST_USER=postgres
|
31
|
+
- PGPORT=5432
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -34,6 +34,25 @@ The best part is that PostgreSQL supports inserting new values at any point of t
|
|
34
34
|
ALTER TYPE status_type ADD VALUE 'pending' BEFORE 'active';
|
35
35
|
```
|
36
36
|
|
37
|
+
## schema.rb Support
|
38
|
+
|
39
|
+
The principle motivation of this gem is to seamlessly integrate PG enums into your `schema.rb` file. This means you can use them in your database columns without switching to `structure.sql`.
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
ActiveRecord::Schema.define(version: 2019_06_19_214914) do
|
43
|
+
|
44
|
+
# These are extensions that must be enabled in order to support this database
|
45
|
+
enable_extension "plpgsql"
|
46
|
+
|
47
|
+
create_enum "status_type", %w[new pending active archived]
|
48
|
+
|
49
|
+
create_table "orders", id: :serial, force: :cascade do |t|
|
50
|
+
t.enum "status", as: "status_type", default: "new"
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
37
56
|
## Version support
|
38
57
|
|
39
58
|
Every version of Rails with an `enum` macro is supported. This means 4.1 through master. Yes, this was annoying and difficult.
|
@@ -118,9 +137,9 @@ There's no technical reason why you couldn't detect enum columns at startup time
|
|
118
137
|
|
119
138
|
## Development
|
120
139
|
|
121
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
140
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `appraisal rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
122
141
|
|
123
|
-
Test a specific version with `
|
142
|
+
Test a specific version with `appraisal 6.0 rake spec`. This is usually necessary because different versions have different Ruby version support.
|
124
143
|
|
125
144
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
126
145
|
|
data/Rakefile
CHANGED
data/bin/setup
CHANGED
data/gemfiles/4.1.gemfile.lock
CHANGED
data/gemfiles/4.2.gemfile.lock
CHANGED
data/gemfiles/5.0.gemfile.lock
CHANGED
data/gemfiles/5.1.gemfile.lock
CHANGED
data/gemfiles/5.2.gemfile.lock
CHANGED
data/gemfiles/6.0.gemfile
CHANGED
data/gemfiles/6.0.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
activerecord-pg_enum (0.
|
4
|
+
activerecord-pg_enum (1.0.0)
|
5
5
|
activerecord (>= 4.1.0)
|
6
6
|
activesupport
|
7
7
|
pg
|
@@ -9,17 +9,17 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (6.0.0
|
13
|
-
activesupport (= 6.0.0
|
14
|
-
activerecord (6.0.0
|
15
|
-
activemodel (= 6.0.0
|
16
|
-
activesupport (= 6.0.0
|
17
|
-
activesupport (6.0.0
|
12
|
+
activemodel (6.0.0)
|
13
|
+
activesupport (= 6.0.0)
|
14
|
+
activerecord (6.0.0)
|
15
|
+
activemodel (= 6.0.0)
|
16
|
+
activesupport (= 6.0.0)
|
17
|
+
activesupport (6.0.0)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (>= 0.7, < 2)
|
20
20
|
minitest (~> 5.1)
|
21
21
|
tzinfo (~> 1.1)
|
22
|
-
zeitwerk (~> 2.1, >= 2.1.
|
22
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
23
23
|
appraisal (2.2.0)
|
24
24
|
bundler
|
25
25
|
rake
|
@@ -53,13 +53,13 @@ GEM
|
|
53
53
|
thread_safe (0.3.6)
|
54
54
|
tzinfo (1.2.5)
|
55
55
|
thread_safe (~> 0.1)
|
56
|
-
zeitwerk (2.1.
|
56
|
+
zeitwerk (2.1.9)
|
57
57
|
|
58
58
|
PLATFORMS
|
59
59
|
ruby
|
60
60
|
|
61
61
|
DEPENDENCIES
|
62
|
-
activerecord (= 6.0.0
|
62
|
+
activerecord (= 6.0.0)
|
63
63
|
activerecord-pg_enum!
|
64
64
|
appraisal
|
65
65
|
bundler (~> 1.15)
|
data/gemfiles/edge.gemfile.lock
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-pg_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Lassek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- ".travis.yml"
|
136
136
|
- Appraisals
|
137
137
|
- CHANGELOG.md
|
138
|
+
- Gemfile
|
138
139
|
- LICENSE
|
139
140
|
- README.md
|
140
141
|
- Rakefile
|