scenic 1.5.0 → 1.5.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: 4f976353b8ba2818670c650b1ee7af50aff76955d94375db07b78377ca1dea10
4
- data.tar.gz: 4756b733801359a9a542cf6cb0a2216086c3b1c8fad50489044202c5b801d1e2
3
+ metadata.gz: 4e48c4898ced79e149309b431569eff692ef95ff075a57ad0a02f2b80b59a262
4
+ data.tar.gz: 7de8b684edffe599452d125aaed7f32111bfc4f99ef4b7e475ca0b2882c7c137
5
5
  SHA512:
6
- metadata.gz: af4652c0978530b0b54de384ffc02ded0587c8361be9cfaf619c0dd2996fd4a6cd0f3fe6fe949bcb51bb5b10320763b5501a0838ac4b4578e74617c9bcf45068
7
- data.tar.gz: b31585a640b9ea5a51586cbfda42b62a4ad90e458a04730b9ee9a8376a62f63095beae991b9c67aa8c3bd8d23bb2d91a64986d18b41a6ef7b79ca7a9ee120a52
6
+ metadata.gz: 5a3f7c1e233cd63be18a94ac39c44f36baff1f1c1ba6cdcc71aa31063c52c2220b3321455a2e904366c157ed419d0a20454dccfdd22e66e42508584865f0aabe
7
+ data.tar.gz: 0ee497506b13cdf2b64c49aea4b18fc351cf620b902acb962a8c9b5281c319b37b473f56ecfbcb873f4561e521780a54c6c6269d43ac841cfc4a3508213a61af
data/NEWS.md CHANGED
@@ -5,6 +5,15 @@ changelog, see the [CHANGELOG] for each version via the version links.
5
5
 
6
6
  [CHANGELOG]: https://github.com/scenic-views/scenic/commits/master
7
7
 
8
+ ## [1.5.1] - February 10, 2019
9
+
10
+ ### Fixed
11
+
12
+ - Passing `no_data: true` when creating a materialized view would error if the
13
+ corresponding SQL file had statement-terminating semicolon.
14
+
15
+ [1.5.1]: https://github.com/scenic-views/scenic/compare/v1.5.0...v1.5.1
16
+
8
17
  ## [1.5.0] - February 8, 2019
9
18
 
10
19
  ### Added
@@ -134,9 +134,10 @@ module Scenic
134
134
  # @return [void]
135
135
  def create_materialized_view(name, sql_definition, no_data: false)
136
136
  raise_unless_materialized_views_supported
137
+
137
138
  execute <<-SQL
138
139
  CREATE MATERIALIZED VIEW #{quote_table_name(name)} AS
139
- #{sql_definition}
140
+ #{sql_definition.rstrip.chomp(';')}
140
141
  #{'WITH NO DATA' if no_data};
141
142
  SQL
142
143
  end
@@ -1,3 +1,3 @@
1
1
  module Scenic
2
- VERSION = "1.5.0".freeze
2
+ VERSION = "1.5.1".freeze
3
3
  end
@@ -27,6 +27,20 @@ module Scenic
27
27
  expect(view.materialized).to eq true
28
28
  end
29
29
 
30
+ it "handles semicolon in definition when using `with no data`" do
31
+ adapter = Postgres.new
32
+
33
+ adapter.create_materialized_view(
34
+ "greetings",
35
+ "SELECT text 'hi' AS greeting; \n",
36
+ no_data: true,
37
+ )
38
+
39
+ view = adapter.views.first
40
+ expect(view.name).to eq("greetings")
41
+ expect(view.materialized).to eq true
42
+ end
43
+
30
44
  it "raises an exception if the version of PostgreSQL is too old" do
31
45
  connection = double("Connection", supports_materialized_views?: false)
32
46
  connectable = double("Connectable", connection: connection)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scenic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Prior
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-09 00:00:00.000000000 Z
12
+ date: 2019-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal