activerecord-viewmatic 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 133bff3848fe0b250115e32cae7733867d018903
4
- data.tar.gz: 7c128e357ef568478c0a48c67e8a269592e2375b
3
+ metadata.gz: fe90f84304d2f6bb84dd4009eafff2fe74232fee
4
+ data.tar.gz: 597a19b10d18b280608aa2b69405ae76b8c3731a
5
5
  SHA512:
6
- metadata.gz: 44389971cb0a3024360b92601d3c21deae97760f9d8ff03d645ae847be82b0fc1ef4ee5566274c3641617f92906bdaf1f8f1c0bdced0dd282b504862a433a3ba
7
- data.tar.gz: 9c35803b88d5b73de127965d44866e027bf7c3cf30c30543441523fa87e683dca9a3f5157bc8a73a5368b8e691337995decafcbbdab337506becd3c27892ff82
6
+ metadata.gz: 6bef78ade09da10d0189d9c7088c0abff026d4e79d9fc87ce5fee8064bde83007a4426ce8737bb22e2971c4eec9c2406368ee5a60f925377f6cb690996b89dd1
7
+ data.tar.gz: f74a08660d77d4b3100a87788c0d680cdf533761418fa98b8c97dc1485852a639fade8f85fe7718f45448cff51da93fa684b81ca69e6c57b400513f670667f8f
data/README.md CHANGED
@@ -36,7 +36,7 @@ class AddMyNewViews < ActiveRecord::Migration
36
36
 
37
37
  def down
38
38
  drop_view :reticulated_splines
39
- drop_view :pending_orders
39
+ drop_view :pending_orders, materialized: true
40
40
  end
41
41
  end
42
42
  ```
@@ -6,19 +6,22 @@ module Viewmatic
6
6
  #
7
7
  # Create the view named in "name". It must be defined in the view definitions file.
8
8
  #
9
- # @param [Symbol] name
9
+ # @param name [Symbol]
10
10
  #
11
11
  def create_view(name)
12
- execute SchemaStatements.create_view Viewmatic.view name
12
+ view = Viewmatic.view name
13
+ execute SchemaStatements.create_view view
13
14
  end
14
15
 
15
16
  #
16
17
  # Drop the view named in "name". It must be defined in the view definitions file.
17
18
  #
18
- # @param [Symbol] name
19
+ # @param name [Symbol]
20
+ # @param materialized [Boolean] true if you're dropping a materialized view
19
21
  #
20
- def drop_view(name)
21
- execute SchemaStatements.drop_view Viewmatic.view name
22
+ def drop_view(name, materialized: false)
23
+ view = View.new name, materialized: materialized
24
+ execute SchemaStatements.drop_view view
22
25
  end
23
26
  end
24
27
  end
@@ -1,4 +1,4 @@
1
1
  module Viewmatic
2
2
  # Library version
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
@@ -7,10 +7,11 @@ module Viewmatic
7
7
  # Initialize a new view.
8
8
  #
9
9
  # @param name [Symbol] name of the view as it will appear in the database
10
+ # @param materialized [Boolean] true if this is to be a materialized view
10
11
  #
11
- def initialize(name)
12
+ def initialize(name, materialized: false)
12
13
  @name = name
13
- @materialized = false
14
+ @materialized = materialized
14
15
  end
15
16
 
16
17
  # Get/set the view name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-viewmatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger
@@ -30,7 +30,7 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.2'
33
- description: Helpers for using live and materialized views ActiveRecord
33
+ description: Helpers for using live and materialized views in ActiveRecord
34
34
  email: jordan.hollinger@gmail.com
35
35
  executables: []
36
36
  extensions: []