dyna_model 0.0.9 → 0.0.10
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.
- checksums.yaml +4 -4
- data/lib/dyna_model/extensions/s3_backup.rb +3 -3
- data/lib/dyna_model/schema.rb +1 -1
- data/lib/dyna_model/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d5e27d9e9de34a45c6ec3390a074995175dbad6
|
|
4
|
+
data.tar.gz: 36a109c5554802a340dc51e64de92a699d3420cf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fce744ec9abf3038e262a83c3e1f49a0598de82e8f71f990d609e353a7130437e0b19693cbec1ecfe7e7cb22e43c878e5d39d4dc1da2bfb528360b0faa32f90b
|
|
7
|
+
data.tar.gz: 782765392ab7d3184e660373b6a3a492bf8e8e7f12981d57dffa8427890e44304201fc476f07184c4d38c341f474f192750e67cfcb2ea4a0a439ce9455b56472
|
|
@@ -29,7 +29,7 @@ module DynaModel
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def write_dyna_model_s3_backup!
|
|
32
|
-
self.class.dyna_model_s3_backup_bucket.objects[File.join(self.class.dyna_model_s3_backup_config[:prefix], "#{self.
|
|
32
|
+
self.class.dyna_model_s3_backup_bucket.objects[File.join(self.class.dyna_model_s3_backup_config[:prefix], "#{self.dynamo_db_guid}.json")].write(self.to_dyna_model_s3_backup_json)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def to_dyna_model_s3_backup_json
|
|
@@ -86,9 +86,9 @@ module DynaModel
|
|
|
86
86
|
obj = obj_json["class"].constantize.new
|
|
87
87
|
obj.attributes = obj_json["attributes"]
|
|
88
88
|
if obj.save
|
|
89
|
-
puts "Saved #{obj.
|
|
89
|
+
puts "Saved #{obj.dynamo_db_guid}."
|
|
90
90
|
else
|
|
91
|
-
puts "Failed to save #{obj.
|
|
91
|
+
puts "Failed to save #{obj.dynamo_db_guid}. #{obj.errors.full_messages.to_sentence}"
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
end
|
data/lib/dyna_model/schema.rb
CHANGED
|
@@ -96,7 +96,7 @@ module DynaModel
|
|
|
96
96
|
if range_key_key
|
|
97
97
|
range_key_attribute = self.attributes[range_key_key.to_s]
|
|
98
98
|
raise(ArgumentError, "Could not find attribute definition for range_key #{range_key_key}") unless range_key_attribute
|
|
99
|
-
raise(ArgumentError, "Invalid attribute type for range_key") unless [AWS::Record::Attributes::StringAttr, AWS::Record::Attributes::IntegerAttr, AWS::Record::Attributes::FloatAttr].include?(range_key_attribute.class)
|
|
99
|
+
raise(ArgumentError, "Invalid attribute type for range_key") unless [AWS::Record::Attributes::StringAttr, AWS::Record::Attributes::IntegerAttr, AWS::Record::Attributes::FloatAttr, AWS::Record::Attributes::DateAttr, AWS::Record::Attributes::DateTimeAttr].include?(range_key_attribute.class)
|
|
100
100
|
|
|
101
101
|
validates_presence_of range_key_attribute.name.to_sym
|
|
102
102
|
|
data/lib/dyna_model/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dyna_model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cary Dunn
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|