pgdice 0.3.0 → 0.3.1

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: fba36c27ddb14e741a76b835c50b0174e01aaaa5dda17eec6bb2932320c34908
4
- data.tar.gz: 02a619304426969341ede31c4882b4deac9b21380b362900fad4a03d9a368ed2
3
+ metadata.gz: baa3b75796eec26ca750d8ddbac02e65a950547e7a7c0e5ecae153df99c4d848
4
+ data.tar.gz: 38925c051239b2d766a32349d574ff588ace9dc593af8e0b4750089cf189ceba
5
5
  SHA512:
6
- metadata.gz: 9667cfbb816a7bb7b5f962b646fdab43fdd6fbcc2c5e8017e8523ce160819bfd4b88b45a444a8654bf627eb282c5d139e515dddfd64efa926204ac103bc80c57
7
- data.tar.gz: 2965757a70d340024a67971ec6a9dd5ca0218454d6dab363876a1ef7ea9493cf5681f478bd95ae8b294349cb75b40c1e43266ce714b731813b74b2ad146e5471
6
+ metadata.gz: 945a4449998d4ae78dbf13569e60e65d691facb01f1cbe100cdc989af1654453fa74366ab2db8b351b82948aa3219d13779ac22134bfe21b29ffabfa02f04089
7
+ data.tar.gz: 3e2fd18360da4861befd6132a75574ddbba1fe6e38ccac5a743a913c2373e08671015bf5bf9193988d190186f643c1b7bd377366adae8fa8a25ace0510006a5a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+
6
+ ## [v0.3.1] : 2018-10-22
7
+ ### Changes
8
+ - Bump up `approved_tables` to `PgDice` module.
9
+
5
10
  ## [v0.3.0] : 2018-10-21
6
11
  ### Changes
7
12
  - Delegate methods from the management classes onto the `PgDice` module itself.
data/README.md CHANGED
@@ -217,7 +217,7 @@ _Dropping tables is irreversible! Do this at your own risk!!_
217
217
  If you want to drop old tables (after backing them up of course) you can run:
218
218
 
219
219
  ```ruby
220
- PgDice.drop_old_partitions(table_name: 'comments')
220
+ PgDice.drop_old_partitions('comments')
221
221
  ```
222
222
 
223
223
  #### Notes on `drop_old_partitions`
@@ -243,6 +243,16 @@ An [InsufficientTablesError](lib/pgdice.rb) will be raised if any conditions are
243
243
  This will check that there are 7 future tables from now and that there are 90 past tables
244
244
  per our configuration above.
245
245
 
246
+ ## Listing approved tables
247
+
248
+ Sometimes you might need to know the tables configured for `PgDice`. To list the configured tables
249
+ you can run:
250
+ ```ruby
251
+ PgDice.approved_tables
252
+ ```
253
+
254
+ The [ApprovedTables](lib/pgdice/approved_tables.rb) object responds to the most common enumerable methods.
255
+
246
256
 
247
257
  # FAQ
248
258
 
@@ -259,7 +269,7 @@ per our configuration above.
259
269
  end
260
270
  ```
261
271
 
262
- 1. I'm seeing off-by-one errors for my `validation.assert_tables` calls?
272
+ 1. I'm seeing off-by-one errors for my `assert_tables` calls?
263
273
  - You should make sure your database is configured to use `UTC`.
264
274
  [https://www.postgresql.org/docs/10/datatype-datetime.html](https://www.postgresql.org/docs/10/datatype-datetime.html)
265
275
 
@@ -6,7 +6,7 @@ module PgDice
6
6
  attr_reader :tables
7
7
  extend Forwardable
8
8
 
9
- def_delegators :@tables, :size, :empty?
9
+ def_delegators :@tables, :size, :empty?, :map, :each, :each_with_index, :to_a
10
10
 
11
11
  def initialize(*args)
12
12
  @tables = args.flatten.compact
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgDice
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
data/lib/pgdice.rb CHANGED
@@ -55,6 +55,7 @@ module PgDice
55
55
  :list_droppable_partitions, :list_droppable_partitions_by_batch_size
56
56
  def_delegators :partition_helper, :partition_table, :undo_partitioning, :undo_partitioning!
57
57
  def_delegators :validation, :assert_tables
58
+ def_delegators :configuration, :approved_tables
58
59
 
59
60
  def partition_manager
60
61
  raise PgDice::NotConfiguredError, 'partition_manager' unless configuration
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgdice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-21 00:00:00.000000000 Z
11
+ date: 2018-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg