activerecord-postgres_enum 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: e97d08a739660755211e03868a76e345eba7546be13b374619a644dfa048ab11
4
- data.tar.gz: d37271b37da014e68ad570a071e8841e3e851552d001084ac5668b4bd43b58f6
3
+ metadata.gz: 11be6863582ca701d4d5d01e48fef1c95c6654c5889d6c82823e7eeb7e548667
4
+ data.tar.gz: c7324a3933d4345cb222d3378dcd74815a7860ec5d4c90e01bf4cb213c986b61
5
5
  SHA512:
6
- metadata.gz: b1486eeb1f2621cc0f2625fffb52ccbb56c272c95238587a93a7ced95ec743aeb333ee441cfc566d9a6d346e896ef3300dbef8f5348632d0b9e3c527adedbcb4
7
- data.tar.gz: 338a9914209f6797286e6e90658a867682289909539cadb4c3d8e4de5cf7ebd6ad6d803c2e1ed7e197f0fbe0e2134c8dc9542da937708d5640bcaf6c5930a2a5
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
- **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.
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.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PostgresEnum
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
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.0.0
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-05-29 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord