cequel 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -70,12 +70,17 @@ module Cequel
70
70
  end
71
71
 
72
72
  def save
73
- updates = {}
74
- @changed_columns.each do |column|
75
- updates[column] = serialize_value(@row[column])
73
+ batch_size = self.class.default_batch_size
74
+ @changed_columns.each_slice(batch_size) do |slice|
75
+ updates = {}
76
+ slice.each do |column|
77
+ updates[column] = serialize_value(@row[column])
78
+ end
79
+ scope.update(updates) if updates.any?
80
+ end
81
+ @deleted_columns.each_slice(batch_size) do |slice|
82
+ scope.delete(*slice.to_a) if slice.any?
76
83
  end
77
- scope.update(updates) if updates.any?
78
- scope.delete(*@deleted_columns.to_a) if @deleted_columns.any?
79
84
  @changed_columns.clear
80
85
  @deleted_columns.clear
81
86
  self
@@ -1,3 +1,3 @@
1
1
  module Cequel
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-29 00:00:00.000000000 Z
14
+ date: 2013-01-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport