pg_party 0.4.1 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1c257e213be1e52a6da2ad268eeb404ccc8441d
4
- data.tar.gz: 704e6b32dc90ffd76f4ebfd10fe7b519ada48954
3
+ metadata.gz: 85fa2f5792258d5519df5df148eab1fce17d2f3a
4
+ data.tar.gz: f1881d32c2ba397dc1fc4ae99304480ee2234eed
5
5
  SHA512:
6
- metadata.gz: 4884251eed06950994a907bc9a93c8481bab18f9e31e07bfba7850d9df73383daf80d5bc760588144989a31226d7eb3a4602ea0e01048210b6e01b56090c8093
7
- data.tar.gz: b0092da4a7434abe85e8b12cfc47fb5c122fa8f52398e452276985b908044bf2496d9e7de2218a5a5e8221da0dee92d55cb3dbda2459b4c723eae684a5deb84c
6
+ metadata.gz: 9f15450a444d4611195a21463b26e2fdcf840598e4893593df832f53ada93d9641e5935c8591c45f536dfb41a682e944a254b3a6e4b5e08f600ba46fdfff85b5
7
+ data.tar.gz: bf3c288225c95debf9c1e10060ed1c9b41eb96ec55f2d1d86931fadb0290acda0c758a8815c9b6927f0f7d144483595710f62e30736ad37bcf5354bf22d4b02d
data/README.md CHANGED
@@ -11,9 +11,13 @@
11
11
  [ActiveRecord](http://guides.rubyonrails.org/active_record_basics.html) migrations and model helpers for creating and managing [PostgreSQL 10 partitions](https://www.postgresql.org/docs/10/static/ddl-partitioning.html)!
12
12
 
13
13
  Features:
14
- - migration methods for partition specific database operations
15
- - model methods for querying partitioned data
16
- - model methods for creating adhoc partitions
14
+ - Migration methods for partition specific database operations
15
+ - Model methods for querying partitioned data
16
+ - Model methods for creating adhoc partitions
17
+
18
+ Limitations:
19
+ - Partition tables are not represented correctly in `db/schema.rb` — please use the `:sql` schema format
20
+ - Only single column partition keys supported (e.g., `column`, `column::cast`)
17
21
 
18
22
  ## Installation
19
23
 
@@ -184,10 +188,8 @@ SomeListRecord.partitions
184
188
  Query for records by partition name:
185
189
 
186
190
  ```ruby
187
- # returns a collection of anonymous ActiveRecord::Base subclassed instances
188
191
  SomeRangeRecord.in_partition(:some_range_records_partition_name)
189
192
 
190
- # returns a collection of anonymous ActiveRecord::Base subclassed instances
191
193
  SomeListRecord.in_partition(:some_list_records_partition_name)
192
194
  ```
193
195
 
@@ -54,6 +54,18 @@ module PgParty
54
54
  def child_class(table_name)
55
55
  Class.new(__getobj__) do
56
56
  self.table_name = table_name
57
+
58
+ # when returning records from a query, Rails
59
+ # allocates objects first, then initializes
60
+ def self.allocate
61
+ superclass.allocate
62
+ end
63
+
64
+ # not sure if this will ever get called,
65
+ # but probably a good idea to have
66
+ def self.new(*args, &blk)
67
+ superclass.new(*args, &blk)
68
+ end
57
69
  end
58
70
  end
59
71
 
@@ -1,3 +1,3 @@
1
1
  module PgParty
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Krage