activerecord-postgres_enum 1.0.0 → 1.1.0
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 +12 -1
- data/lib/active_record/postgres_enum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11be6863582ca701d4d5d01e48fef1c95c6654c5889d6c82823e7eeb7e548667
|
4
|
+
data.tar.gz: c7324a3933d4345cb222d3378dcd74815a7860ec5d4c90e01bf4cb213c986b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a65ec7099464c6f1fd5863efdad17316702cc4a0427c2ed6008a42e059f72c22d094b79a564c6880da5072c3cd3f0db3bd36ddf4bde1e8a847fa5391623c1e9
|
7
|
+
data.tar.gz: '099ee04842e690d703ff3e859067c5b07c22bc52a03166caedce11f03060365b11f6140d7e614d83cd692eef8b4a8bc06f3ace730d17a68a5913953d91c5c11a'
|
data/README.md
CHANGED
@@ -56,7 +56,15 @@ To add a value into existing enum:
|
|
56
56
|
add_enum_value :mood, "pensive"
|
57
57
|
```
|
58
58
|
|
59
|
-
|
59
|
+
To add a new enum column to an existing table:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
def change
|
63
|
+
create_enum :product_type, %w[one-off subscription]
|
64
|
+
|
65
|
+
add_column :products, :type, :product_type
|
66
|
+
end
|
67
|
+
```
|
60
68
|
|
61
69
|
To rename a value:
|
62
70
|
|
@@ -64,6 +72,9 @@ To rename a value:
|
|
64
72
|
rename_enum_value :mood, "pensive", "wistful"
|
65
73
|
```
|
66
74
|
|
75
|
+
**NB:** To stop Postgres complaining about adding enum values inside a transaction, use [`disable_ddl_transaction!`](https://api.rubyonrails.org/classes/ActiveRecord/Migration.html#method-c-disable_ddl_transaction-21) in your migration.
|
76
|
+
|
77
|
+
|
67
78
|
## Development
|
68
79
|
|
69
80
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgres_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Merkushin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|