Skip to content

Commit

Permalink
Merge pull request #18 from IlluminusLimited/bump_up_approved_tables
Browse files Browse the repository at this point in the history
bumped up approved tables and added test for enumerable behavior
  • Loading branch information
scytherswings authored Nov 22, 2018
2 parents 3775932 + b2e9d1c commit 34e470b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [v0.3.1] : 2018-10-22
### Changes
- Bump up `approved_tables` to `PgDice` module.

## [v0.3.0] : 2018-10-21
### Changes
- Delegate methods from the management classes onto the `PgDice` module itself.
Expand Down
1 change: 1 addition & 0 deletions lib/pgdice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class << self
:list_droppable_partitions, :list_droppable_partitions_by_batch_size
def_delegators :partition_helper, :partition_table, :undo_partitioning, :undo_partitioning!
def_delegators :validation, :assert_tables
def_delegators :configuration, :approved_tables

def partition_manager
raise PgDice::NotConfiguredError, 'partition_manager' unless configuration
Expand Down
2 changes: 1 addition & 1 deletion lib/pgdice/approved_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ApprovedTables
attr_reader :tables
extend Forwardable

def_delegators :@tables, :size, :empty?
def_delegators :@tables, :size, :empty?, :map, :each, :each_with_index, :to_a

def initialize(*args)
@tables = args.flatten.compact
Expand Down
2 changes: 1 addition & 1 deletion lib/pgdice/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module PgDice
VERSION = '0.3.0'
VERSION = '0.3.1'
end
5 changes: 5 additions & 0 deletions test/pgdice/approved_tables_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ def test_comparison_of_tables

refute approved_tables == other_tables
end

def test_all_tables_is_enumerable
approved_tables = PgDice.configuration.approved_tables
assert_equal approved_tables.tables.map(&:name), PgDice.approved_tables.map(&:name)
end
end

0 comments on commit 34e470b

Please sign in to comment.