storext 0.2.0 → 0.2.1

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: 1da3c0f4de333dec59e7b7c8821bc3f739ac3df8
4
- data.tar.gz: 88b15eeb254370c4d2b640d6d627bb4ef1917aba
3
+ metadata.gz: 4305f2288cae4be148bd2894bec0179e6f133d1d
4
+ data.tar.gz: b3bb3521ad5ed2d442dadf58e6c82bd8948a5c49
5
5
  SHA512:
6
- metadata.gz: e2bda6c2e05d733fdeb02d657d75acbcea0f21f5b354460bc43bd4b78364fe6088d8423e02198f47d9ea4b81c8d380eb9f152fedb9e1f3ac28e38b85939c89c9
7
- data.tar.gz: af708a1b323d18698655f97b9c7319db44f637b68366f904ca126ce63facc3326d536134284ea7cb27f95442296952014c88cfea67d0fd791141acf743cff860
6
+ metadata.gz: 6b92816e609332686a166e1f0477eb2d341edfb9c08a624661abc9eb4ddbe01fb184ced48911d10246b574446b04ff129168d5d6282baff9c6ea177c5adea878
7
+ data.tar.gz: a50ae3d082e6ada9f2a610b647899d9f53babbf4ad233c180b3fb620cc9e7c22845f4f1d90d7a8ba276aebc9e6231b7f80d71229b9abc59b673bb6d0867ecbcf
@@ -4,6 +4,10 @@ module Storext
4
4
  private
5
5
 
6
6
  def set_storext_defaults
7
+ self.class.storext_options.each do |column, default|
8
+ self.send("#{column}=", default) if self.send(column).nil?
9
+ end
10
+
7
11
  store_attribute_defs.each do |attr, definition|
8
12
  set_storext_default_for(definition[:column], attr)
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module Storext
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/storext.rb CHANGED
@@ -41,12 +41,6 @@ module Storext
41
41
  end
42
42
 
43
43
  after_initialize :set_storext_defaults
44
-
45
- self.storext_options.each do |column, default|
46
- self.send :define_method, column do
47
- self.read_attribute(column) || default
48
- end
49
- end
50
44
  end
51
45
 
52
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5