activerecord-simpledb-adapter 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{activerecord-simpledb-adapter}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ilia Ablamonov", "Alex Gorkunov", "Cloud Castle Inc."]
@@ -68,6 +68,8 @@ module ActiveRecord
68
68
 
69
69
  def commit_batch type = nil
70
70
  count = batch_pool.inject(0) {|sum, (key, value)| sum += value.count }
71
+ clear_batch and return unless count
72
+
71
73
  log({:count => count }.inspect, "SimpleDB Batch Operation") do
72
74
  pool = batch_pool[:update]
73
75
  @connection.batch_put_attributes(domain_name, pool) \
@@ -74,7 +74,7 @@ describe "SimpleDBAdapter ActiveRecord batches operation" do
74
74
  end
75
75
 
76
76
  it "should auto split to several batches when count of items more than BATCH_MAX_ITEM_COUNT" do
77
- count = 35
77
+ count = 50
78
78
  Person.batch do
79
79
  count.times { |i| Person.create_valid }
80
80
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-simpledb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ilia Ablamonov