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 +4 -4
- data/README.md +1 -1
- data/lib/viewmatic/migration.rb +8 -5
- data/lib/viewmatic/version.rb +1 -1
- data/lib/viewmatic/view.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe90f84304d2f6bb84dd4009eafff2fe74232fee
|
4
|
+
data.tar.gz: 597a19b10d18b280608aa2b69405ae76b8c3731a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bef78ade09da10d0189d9c7088c0abff026d4e79d9fc87ce5fee8064bde83007a4426ce8737bb22e2971c4eec9c2406368ee5a60f925377f6cb690996b89dd1
|
7
|
+
data.tar.gz: f74a08660d77d4b3100a87788c0d680cdf533761418fa98b8c97dc1485852a639fade8f85fe7718f45448cff51da93fa684b81ca69e6c57b400513f670667f8f
|
data/README.md
CHANGED
data/lib/viewmatic/migration.rb
CHANGED
@@ -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]
|
9
|
+
# @param name [Symbol]
|
10
10
|
#
|
11
11
|
def create_view(name)
|
12
|
-
|
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]
|
19
|
+
# @param name [Symbol]
|
20
|
+
# @param materialized [Boolean] true if you're dropping a materialized view
|
19
21
|
#
|
20
|
-
def drop_view(name)
|
21
|
-
|
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
|
data/lib/viewmatic/version.rb
CHANGED
data/lib/viewmatic/view.rb
CHANGED
@@ -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 =
|
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.
|
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: []
|