vault-rails 0.0.7 → 0.0.8

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.
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Rails
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -45,16 +45,29 @@ class Vault
45
45
  window.setTimeout @options.after_load, 100
46
46
  else
47
47
  # No modifications in offline data; reload fresh data.
48
- @reload(@options.after_load)
48
+ if @urls.list?
49
+ @reload(@options.after_load)
50
+ else
51
+ # Can't reload without a list url; use the offline data.
52
+ @options.after_load()
49
53
  else
50
54
  if navigator.onLine
51
55
  # Load failed, but we're connected; reload fresh data.
52
- @reload(@options.after_load)
56
+ if @urls.list?
57
+ @reload(@options.after_load)
58
+ else
59
+ # Can't reload without a list url; use an empty dataset.
60
+ @options.after_load()
53
61
  else
54
62
  # Load failed and we're offline; log an error.
55
63
  @errors.push "Offline data failed to load. Could not load live data as browser is offline."
56
64
  else
57
- @reload(@options.after_load)
65
+ # Not using offline data; reload fresh data.
66
+ if @urls.list?
67
+ @reload(@options.after_load)
68
+ else
69
+ # Can't reload without a list url; use an empty dataset.
70
+ @options.after_load()
58
71
 
59
72
  # Create convenience attributes for sub-collections.
60
73
  for sub_collection in @options.sub_collections
@@ -303,6 +316,9 @@ class Vault
303
316
  else if not navigator.onLine
304
317
  @errors.push 'Cannot reload, navigator is offline.'
305
318
  return after_load()
319
+ else if not @urls.list?
320
+ @errors.push 'Cannot reload, list url is not configured.'
321
+ return after_load()
306
322
 
307
323
  # Lock the vault until the reload is complete.
308
324
  @locked = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-24 00:00:00.000000000Z
12
+ date: 2011-12-01 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Store and manage collections of objects without a connection.
15
15
  email: