pg_party 0.7.2 → 0.7.3

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: 2eee444e0ce9baf767d5726bfe1c3f0a53fec0d7
4
- data.tar.gz: 3c22b58fc7dceba390af9a2f7625c6e37ef0cb5a
3
+ metadata.gz: 4b3cbb99316596bf151d53ef3d550d449e7f7853
4
+ data.tar.gz: 2f0185c8e5ae5b8928ae0c196eafe0b72dbca215
5
5
  SHA512:
6
- metadata.gz: 8628f4d972a5fb485d96392704d5a63677c37da498599620a984a67e79778f05d4b4534c84a2ba9788290c6777eee5851cd8f2fa08fa86101ecfad8e496f0da8
7
- data.tar.gz: 05476083807bc9bd20773c445f44a2a821de1135faca48e235854220172960251925305d3dadfac90fe37c843c028754a38f97a973aad2cec3496e3c11efb77b
6
+ metadata.gz: 4a6a84178f454a81549f02ddd3e2871de48269a8ac86e6f1e68a6df8f8bd40cc8b85945e8914879a8a5543fc71257792d44cf0de0d20dda0c7b67fe0afcceac6
7
+ data.tar.gz: 1cb16eaf85e97774734eff7e316a404c3d6980e1d95932d6f145cef74f17db83f79e48cc264812c32ff696a135dc82c4f815f0f4624a4d176d416e85a5338e4c
data/README.md CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/pg_party.svg)][rubygems]
4
4
  [![Build Status](https://circleci.com/gh/rkrage/pg_party.svg?&style=shield)][circle]
5
- [![Code Climate](https://codeclimate.com/github/rkrage/pg_party/badges/gpa.svg)][climate]
6
- [![Code Coverage](https://codeclimate.com/github/rkrage/pg_party/badges/coverage.svg)][coverage]
7
5
  [![Dependency Status](https://gemnasium.com/badges/github.com/rkrage/pg_party.svg)][gemnasium]
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c409453d2283dd440227/maintainability)][cc_maintainability]
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/c409453d2283dd440227/test_coverage)][cc_coverage]
8
8
 
9
- [rubygems]: https://rubygems.org/gems/pg_party
10
- [circle]: https://circleci.com/gh/rkrage/pg_party
11
- [climate]: https://codeclimate.com/github/rkrage/pg_party
12
- [coverage]: https://codeclimate.com/github/rkrage/pg_party/coverage
13
- [gemnasium]: https://gemnasium.com/github.com/rkrage/pg_party
9
+ [rubygems]: https://rubygems.org/gems/pg_party
10
+ [circle]: https://circleci.com/gh/rkrage/pg_party/tree/master
11
+ [gemnasium]: https://gemnasium.com/github.com/rkrage/pg_party
12
+ [cc_maintainability]: https://codeclimate.com/github/rkrage/pg_party/maintainability
13
+ [cc_coverage]: https://codeclimate.com/github/rkrage/pg_party/test_coverage
14
14
 
15
15
  [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)!
16
16
 
@@ -104,7 +104,13 @@ Attach an existing table to a range partition:
104
104
  ```ruby
105
105
  class AttachRangePartition < ActiveRecord::Migration[5.1]
106
106
  def up
107
- attach_range_partition :parent_table, :child_table
107
+ current_date = Date.current
108
+
109
+ attach_range_partition \
110
+ :some_range_records,
111
+ :some_existing_table,
112
+ start_range: current_date,
113
+ end_range: current_date + 1.day
108
114
  end
109
115
  end
110
116
  ```
@@ -114,7 +120,10 @@ Attach an existing table to a list partition:
114
120
  ```ruby
115
121
  class AttachListPartition < ActiveRecord::Migration[5.1]
116
122
  def up
117
- attach_list_partition :parent_table, :child_table
123
+ attach_list_partition \
124
+ :some_list_records,
125
+ :some_existing_table,
126
+ values: (200..300).to_a
118
127
  end
119
128
  end
120
129
  ```
@@ -133,6 +133,18 @@ module PgParty
133
133
  child_table_name
134
134
  end
135
135
 
136
+ # Rails 5.2 now returns boolean literals
137
+ # This causes partition creation to fail when the constraint clause includes a boolean
138
+ # Might be a PostgreSQL bug, but for now let's revert to the old quoting behavior
139
+ def quote(value)
140
+ case value
141
+ when true then "'t'"
142
+ when false then "'f'"
143
+ else
144
+ __getobj__.quote(value)
145
+ end
146
+ end
147
+
136
148
  def quote_partition_key(key)
137
149
  key.to_s.split("::").map(&method(:quote_column_name)).join("::")
138
150
  end
@@ -1,3 +1,3 @@
1
1
  module PgParty
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_party
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Krage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-30 00:00:00.000000000 Z
11
+ date: 2018-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
240
  version: 1.8.11
241
241
  requirements: []
242
242
  rubyforge_project:
243
- rubygems_version: 2.4.5
243
+ rubygems_version: 2.6.11
244
244
  signing_key:
245
245
  specification_version: 4
246
246
  summary: ActiveRecord PostgreSQL Partitioning