kolo 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,11 +68,7 @@ class Db
68
68
  viewModel.loading true
69
69
  @onBeforeLoad() if @onBeforeLoad?
70
70
  $.get @url, (data)=>
71
- for itemData in @itemDataFrom(data)
72
- item = @findOrCreate itemData.id
73
- item.updateAttributes itemData
74
- if @sortFunction?
75
- @items.sort @sortFunction
71
+ @doLoad(data)
76
72
  @onAfterLoad() if @onAfterLoad?
77
73
  viewModel.loading false
78
74
  viewModel.systemNotification @plural, 'loaded'
@@ -94,6 +90,13 @@ class Db
94
90
  else
95
91
  @doCreate item
96
92
 
93
+ doLoad: (data)=>
94
+ for itemData in @itemDataFrom(data)
95
+ item = @findOrCreate itemData.id
96
+ item.updateAttributes itemData
97
+ if @sortFunction?
98
+ @items.sort @sortFunction
99
+
97
100
  doCreate: (item)=>
98
101
  viewModel.systemNotification @name, 'saving'
99
102
  viewModel.loading true
data/lib/kolo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kolo
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
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: 2013-03-15 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: 879063153
96
+ hash: 561628045
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 879063153
105
+ hash: 561628045
106
106
  requirements: []
107
107
  rubyforge_project:
108
108
  rubygems_version: 1.8.24