ocean-dynamo 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eaf6828f75761ed94d2acbfa5a28383b892c2d3
4
- data.tar.gz: 9cc793dae4769417a4b87949f6c8a183679f6bc8
3
+ metadata.gz: addd6468880c47057a33bd5f69bb77e83256b3f1
4
+ data.tar.gz: 181a96b183e625822ccec5a37b6305bb24b0517c
5
5
  SHA512:
6
- metadata.gz: ff59c0d44b7c45cdd07702f199b6816f1daedfa9998d0ffe8c6e75f8bff094c46ab55a144e81a57932d8775e758d0af0e378b922815959144294c715e53c3a40
7
- data.tar.gz: ea2b09b9afa20d4a0cf0e6e6d0a7e51b739e0674dd06f9fbbf877a903c31a96e3311e00dad45578948b5a0c5601312f65ceb15539de33c73310a1c09f054a49c
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson