tablature 0.2.0 → 0.3.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/Gemfile.lock +2 -2
- data/lib/tablature/model.rb +23 -4
- data/lib/tablature/version.rb +1 -1
- metadata +2 -3
- data/lib/tablature/model/partition_methods.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f01e862c6cb003f9b1bc86743f0254cccef3637fa87f84ea32b4c96f35b6e3
|
4
|
+
data.tar.gz: 53694558d02632d0445cba1d699b996d822d5954a2103eba18e90a9368f23878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5adfa4f8f12f91c123d34c0425fcc1554fbe79f69feb33667626591c5ebcb24ad983574a16a7f70179524e645ed79c341c143592904ce056bcac01933eab5c5
|
7
|
+
data.tar.gz: d26d13cf166673c56d341aedeecd948a563942c6bf0720b5ff01d6bffd22ee9d2b1de0576e0c88891b2a2a0e551aa192b9e0c32a8dc2f66050edce43ce42a9ee
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tablature (0.
|
4
|
+
tablature (0.3.0)
|
5
5
|
activerecord (>= 5.0.0)
|
6
6
|
railties (>= 5.0.0)
|
7
7
|
|
@@ -48,7 +48,7 @@ GEM
|
|
48
48
|
method_source (0.9.0)
|
49
49
|
mini_portile2 (2.4.0)
|
50
50
|
minitest (5.11.3)
|
51
|
-
nokogiri (1.10.
|
51
|
+
nokogiri (1.10.1)
|
52
52
|
mini_portile2 (~> 2.4.0)
|
53
53
|
pg (0.21.0)
|
54
54
|
pry (0.12.2)
|
data/lib/tablature/model.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'tablature/model/partition_methods'
|
2
|
-
|
3
1
|
module Tablature
|
4
2
|
module Model
|
5
3
|
module ListPartitionMethods
|
@@ -15,15 +13,36 @@ module Tablature
|
|
15
13
|
end
|
16
14
|
|
17
15
|
module ClassMethods
|
16
|
+
extend Forwardable
|
17
|
+
|
18
|
+
def_delegators :tablature_partition, :partitions, :partition_key, :partitioning_method
|
19
|
+
|
20
|
+
def partitioned?
|
21
|
+
begin
|
22
|
+
tablature_partition
|
23
|
+
rescue Tablature::MissingPartition
|
24
|
+
return false
|
25
|
+
end
|
26
|
+
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
def tablature_partition
|
31
|
+
partition = Tablature.database.partitioned_tables.find do |pt|
|
32
|
+
pt.name == partition_name.to_s
|
33
|
+
end
|
34
|
+
raise Tablature::MissingPartition if partition.nil?
|
35
|
+
|
36
|
+
partition
|
37
|
+
end
|
38
|
+
|
18
39
|
def list_partition(partition_name = table_name)
|
19
40
|
setup_partition(partition_name)
|
20
|
-
extend(PartitionMethods)
|
21
41
|
extend(ListPartitionMethods)
|
22
42
|
end
|
23
43
|
|
24
44
|
def range_partition(partition_name = table_name)
|
25
45
|
setup_partition(partition_name)
|
26
|
-
extend(PartitionMethods)
|
27
46
|
extend(RangePartitionMethods)
|
28
47
|
end
|
29
48
|
|
data/lib/tablature/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tablature
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aliou Diallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,7 +154,6 @@ files:
|
|
154
154
|
- lib/tablature/command_recorder.rb
|
155
155
|
- lib/tablature/configuration.rb
|
156
156
|
- lib/tablature/model.rb
|
157
|
-
- lib/tablature/model/partition_methods.rb
|
158
157
|
- lib/tablature/partitioned_table.rb
|
159
158
|
- lib/tablature/railtie.rb
|
160
159
|
- lib/tablature/schema_dumper.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'forwardable'
|
2
|
-
|
3
|
-
module Tablature
|
4
|
-
module Model
|
5
|
-
module PartitionMethods
|
6
|
-
extend Forwardable
|
7
|
-
def_delegators :tablature_partition, :partitions, :partition_key, :partitioning_method
|
8
|
-
|
9
|
-
def tablature_partition
|
10
|
-
partition = Tablature.database.partitioned_tables.find do |pt|
|
11
|
-
pt.name == partition_name.to_s
|
12
|
-
end
|
13
|
-
raise Tablature::MissingPartition if partition.nil?
|
14
|
-
|
15
|
-
partition
|
16
|
-
end
|
17
|
-
|
18
|
-
def partitioned?
|
19
|
-
begin
|
20
|
-
tablature_partition
|
21
|
-
rescue Tablature::MissingPartition
|
22
|
-
return false
|
23
|
-
end
|
24
|
-
|
25
|
-
true
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|