ocean-dynamo 0.2.3 → 0.2.4
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/ocean-dynamo/attributes.rb +0 -3
- data/lib/ocean-dynamo/schema.rb +6 -0
- data/lib/ocean-dynamo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: addd6468880c47057a33bd5f69bb77e83256b3f1
|
4
|
+
data.tar.gz: 181a96b183e625822ccec5a37b6305bb24b0517c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f6c667f3f2f98f7cb37f651c8c9037fdb5e79ea66981b015dda9c15fe6197cc3fbd0391708ef98f19bca497f6ba836e9ead61f5c3328a48b7052484fa91b80
|
7
|
+
data.tar.gz: 29658eef1f543e440417ee2997eeedffe2b03cfeb7a4ce0b739b912e585dd3b4d5bcf77f1f8ae32971e00224a346aa5b8afe6fcf9fc88f69bc1f0eecb569d741
|
@@ -14,9 +14,6 @@ module OceanDynamo
|
|
14
14
|
@attributes = Hash.new
|
15
15
|
fields.each do |name, md|
|
16
16
|
write_attribute(name, evaluate_default(md[:default], md[:type]))
|
17
|
-
self.class.class_eval "def #{name}; read_attribute('#{name.to_s}'); end"
|
18
|
-
self.class.class_eval "def #{name}=(value); write_attribute('#{name.to_s}', value); end"
|
19
|
-
self.class.class_eval "def #{name}?; read_attribute('#{name.to_s}').present?; end"
|
20
17
|
end
|
21
18
|
@dynamo_item = nil
|
22
19
|
@destroyed = false
|
data/lib/ocean-dynamo/schema.rb
CHANGED
@@ -36,6 +36,12 @@ module OceanDynamo
|
|
36
36
|
timestamp_attributes.each { |name| attribute name, :datetime } if timestamp_attributes
|
37
37
|
attribute lock_attribute, :integer, default: 0
|
38
38
|
block.call
|
39
|
+
# Define attribute accessors
|
40
|
+
fields.each do |name, md|
|
41
|
+
self.class_eval "def #{name}; read_attribute('#{name.to_s}'); end"
|
42
|
+
self.class_eval "def #{name}=(value); write_attribute('#{name.to_s}', value); end"
|
43
|
+
self.class_eval "def #{name}?; read_attribute('#{name.to_s}').present?; end"
|
44
|
+
end
|
39
45
|
# Connect to AWS
|
40
46
|
establish_db_connection if connect == true
|
41
47
|
# Finally return the full table name
|
data/lib/ocean-dynamo/version.rb
CHANGED