volt 0.9.5.pre2 → 0.9.5.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/lib/volt/models/array_model.rb +16 -2
- data/lib/volt/models/associations.rb +10 -1
- data/lib/volt/models/field_helpers.rb +1 -0
- data/lib/volt/models/persistors/array_store.rb +2 -2
- data/lib/volt/models/persistors/store.rb +1 -0
- data/lib/volt/server/rack/opal_files.rb +1 -1
- data/lib/volt/utils/csso_patch.rb +14 -0
- data/lib/volt/version.rb +1 -1
- data/spec/models/associations_spec.rb +2 -0
- 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: 552337e005627aa06bff5950bcd94cbb5ab58684
|
4
|
+
data.tar.gz: cf7e89e6862c51796186c9034a62e378e27abcfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c42d896c2c9cb881778a8a90dee2c2ff398213540bbaa4183f13c748106b7f8d0724cf50327ce090e7e1c30dcb7336d758f4a5d5ec61521420b53a33478593d
|
7
|
+
data.tar.gz: ea0d96fa24038a6d45d99a3adb3ee59cd072adef219a48aa7c5543e63de9f52f7abf16fd6564aa4ed740e7cc137fcbd2c65220e38a76cf1e8ea7a664fb7ac868
|
data/README.md
CHANGED
@@ -58,7 +58,3 @@ VoltFramework is currently a labor of love mainly built by a small group of core
|
|
58
58
|
[![Pledgie](https://pledgie.com/campaigns/26731.png?skin_name=chrome)](https://pledgie.com/campaigns/26731)
|
59
59
|
|
60
60
|
Bitcoins can also be sent to 1AYiL3MiSVe2QFyexzozUvFFH7uGCJgJMZ
|
61
|
-
|
62
|
-
|
63
|
-
Timings:
|
64
|
-
- view:
|
@@ -59,8 +59,6 @@ module Volt
|
|
59
59
|
|
60
60
|
def initialize(array = [], options = {})
|
61
61
|
@options = options
|
62
|
-
@parent = options[:parent]
|
63
|
-
@path = options[:path] || []
|
64
62
|
@persistor = setup_persistor(options[:persistor])
|
65
63
|
|
66
64
|
array = wrap_values(array)
|
@@ -74,6 +72,22 @@ module Volt
|
|
74
72
|
end
|
75
73
|
end
|
76
74
|
|
75
|
+
def parent=(val)
|
76
|
+
@options[:parent] = val
|
77
|
+
end
|
78
|
+
|
79
|
+
def parent
|
80
|
+
@options[:parent]
|
81
|
+
end
|
82
|
+
|
83
|
+
def path
|
84
|
+
@options[:path] || []
|
85
|
+
end
|
86
|
+
|
87
|
+
def path=(val)
|
88
|
+
@options[:path] = val
|
89
|
+
end
|
90
|
+
|
77
91
|
def attributes
|
78
92
|
self
|
79
93
|
end
|
@@ -37,7 +37,16 @@ module Volt
|
|
37
37
|
|
38
38
|
define_method(method_name) do
|
39
39
|
lookup_key = get(local_key)
|
40
|
-
get(collection).where(foreign_key => lookup_key)
|
40
|
+
array_model = root.get(collection).where(foreign_key => lookup_key)
|
41
|
+
|
42
|
+
# Since we are coming off of the root collection, we need to setup
|
43
|
+
# the right parent and path.
|
44
|
+
new_path = array_model.options[:path]
|
45
|
+
# Assign path and parent
|
46
|
+
array_model.path = self.path + new_path
|
47
|
+
array_model.parent = self
|
48
|
+
|
49
|
+
array_model
|
41
50
|
end
|
42
51
|
end
|
43
52
|
|
@@ -134,7 +134,7 @@ module Volt
|
|
134
134
|
|
135
135
|
parent.persistor.ensure_setup if parent.persistor
|
136
136
|
|
137
|
-
if parent && (attrs = parent.attributes) && attrs[:id]
|
137
|
+
if parent && !@model.is_a?(Cursor) && (attrs = parent.attributes) && attrs[:id]
|
138
138
|
query = query.dup
|
139
139
|
|
140
140
|
query << [:find, { :"#{@model.path[-3].singularize}_id" => attrs[:id] }]
|
@@ -210,7 +210,7 @@ module Volt
|
|
210
210
|
# Returns a promise that is resolved/rejected when the query is complete. Any
|
211
211
|
# passed block will be passed to the promises then. Then will be passed the model.
|
212
212
|
def fetch(&block)
|
213
|
-
Volt.logger.warn('Deprication warning: in 0.9.3.pre4, all query methods on store now return Promises, so you can juse use .all or .first instead of .
|
213
|
+
Volt.logger.warn('Deprication warning: in 0.9.3.pre4, all query methods on store now return Promises, so you can juse use .all or .first instead of .fetch')
|
214
214
|
promise = Promise.new
|
215
215
|
|
216
216
|
# Run the block after resolve if a block is passed in
|
@@ -19,6 +19,20 @@ module Csso
|
|
19
19
|
def compress css, structural_optimization=true
|
20
20
|
@csso.call("do_compression", css, !structural_optimization)
|
21
21
|
end
|
22
|
+
end
|
23
|
+
|
22
24
|
|
25
|
+
# https://github.com/Vasfed/csso-rails/pull/23/files
|
26
|
+
def self.install(sprockets)
|
27
|
+
if sprockets.respond_to? :register_compressor
|
28
|
+
compressor = Compressor.new
|
29
|
+
sprockets.register_compressor('text/css', :csso, proc { |context, css|
|
30
|
+
compressor.compress(css)
|
31
|
+
})
|
32
|
+
sprockets.css_compressor = :csso
|
33
|
+
else
|
34
|
+
Sprockets::Compressors.register_css_compressor(:csso, 'Csso::Compressor', :default => true)
|
35
|
+
end
|
23
36
|
end
|
37
|
+
|
24
38
|
end
|
data/lib/volt/version.rb
CHANGED
@@ -83,6 +83,8 @@ describe Volt::Associations do
|
|
83
83
|
|
84
84
|
it 'should assign the reference_id for has_many' do
|
85
85
|
bob = store.people.create.sync
|
86
|
+
|
87
|
+
expect(bob.path).to eq([:people, :[]])
|
86
88
|
address = bob.addresses.create({:street => '1234 awesome street'})
|
87
89
|
|
88
90
|
expect(bob.addresses[0].sync.person_id).to eq(bob.id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.5.
|
4
|
+
version: 0.9.5.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|