simple_record 1.1.33 → 1.1.34
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple_record.rb +8 -7
- metadata +2 -2
data/lib/simple_record.rb
CHANGED
@@ -10,8 +10,9 @@
|
|
10
10
|
#
|
11
11
|
# AWS_ACCESS_KEY_ID='XXXXX'
|
12
12
|
# AWS_SECRET_ACCESS_KEY='YYYYY'
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# SimpleRecord.establish_connection(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)
|
14
|
+
#
|
15
|
+
## Save an object
|
15
16
|
# mm = MyModel.new
|
16
17
|
# mm.name = "Travis"
|
17
18
|
# mm.age = 32
|
@@ -39,7 +40,7 @@ module SimpleRecord
|
|
39
40
|
|
40
41
|
# Create a new handle to an Sdb account. All handles share the same per process or per thread
|
41
42
|
# HTTP connection to Amazon Sdb. Each handle is for a specific account.
|
42
|
-
# The +params+ are passed through as-is to
|
43
|
+
# The +params+ are passed through as-is to Aws::SdbInterface.new
|
43
44
|
# Params:
|
44
45
|
# { :server => 'sdb.amazonaws.com' # Amazon service host: 'sdb.amazonaws.com'(default)
|
45
46
|
# :port => 443 # Amazon service port: 80(default) or 443
|
@@ -396,7 +397,7 @@ module SimpleRecord
|
|
396
397
|
# puts 'to eval=' + to_eval
|
397
398
|
begin
|
398
399
|
ret = eval(to_eval) # (defined? #{arg}_id)
|
399
|
-
rescue
|
400
|
+
rescue Aws::ActiveSdb::ActiveSdbError
|
400
401
|
if $!.message.include? "Couldn't find"
|
401
402
|
ret = nil
|
402
403
|
else
|
@@ -617,7 +618,7 @@ module SimpleRecord
|
|
617
618
|
else
|
618
619
|
return false
|
619
620
|
end
|
620
|
-
rescue
|
621
|
+
rescue Aws::AwsError
|
621
622
|
# puts "RESCUED in save: " + $!
|
622
623
|
if (domain_ok($!))
|
623
624
|
if !@create_domain_called
|
@@ -750,7 +751,7 @@ module SimpleRecord
|
|
750
751
|
results << ok
|
751
752
|
next if !ok # todo: this shouldn't be here should it? raises above
|
752
753
|
o.pre_save2
|
753
|
-
to_save <<
|
754
|
+
to_save << Aws::SdbInterface::Item.new(o.id, o.attributes, true)
|
754
755
|
if to_save.size == 25 # Max amount SDB will accept
|
755
756
|
connection.batch_put_attributes(domain, to_save)
|
756
757
|
to_save.clear
|
@@ -763,7 +764,7 @@ module SimpleRecord
|
|
763
764
|
|
764
765
|
#
|
765
766
|
# Usage: ClassName.delete id
|
766
|
-
# todo: move to
|
767
|
+
# todo: move to Aws
|
767
768
|
#
|
768
769
|
def self.delete(id)
|
769
770
|
connection.delete_attributes(domain, id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-11-
|
14
|
+
date: 2009-11-15 00:00:00 -08:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|