storext 1.1.2 → 2.0.0

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: 9edfd660345451735a3f3587d7b8c68189242807
4
- data.tar.gz: e5fb2bfd71a891e369abd50d4e025ddef0cf377a
3
+ metadata.gz: ca085424efbe14372b13c5acdc2f6d224e73f511
4
+ data.tar.gz: 5f81e8c9d8f45e351dbd54d06ecc8360aa775d56
5
5
  SHA512:
6
- metadata.gz: e817a983e22dacd5cb982b15a4ae3e36d0566005d9ef68c8490e67ccf384c8d606cfbdc0cc22b4866e18e7e427f8f8280cdc737b42919a4e4cfa152d19ecfd22
7
- data.tar.gz: b429d952ae335b5eed7fea448389f460c2b34c9394dd0f833f5fdb90f210cba1291123079147f20b512b95e7f3d37eb99a9c34fadd55df63422e45a8c8b0e6c3
6
+ metadata.gz: 23ac6df88a5e6fbe459ceb3bffa71a579560f1f3747b6ff879278e47bf9e6f07a09c16400f0075588fe8761bb02e6301eab75a0ee6134f839ba5f3e61a2fd682
7
+ data.tar.gz: 27f76b0e0a7f476ce2efcfd2efaa53c74c97acb838fd7c42f676e1d00f6018027e4d3a1a085770e74fab0c32469e6013a2c4af988f560a60d480bcfc5a86eb72
@@ -3,9 +3,11 @@ module Storext
3
3
 
4
4
  def storext_define_writer(column, attr)
5
5
  define_method "#{attr}=" do |value|
6
+ coerced_value = storext_cast_proxy.send("#{attr}=", value)
7
+
6
8
  send("#{column}=", send(column) || {})
7
- write_store_attribute column, attr, value
8
- send(column)[attr.to_s] = value
9
+ write_store_attribute column, attr, coerced_value
10
+ send(column)[attr.to_s] = coerced_value
9
11
  end
10
12
  end
11
13
 
@@ -36,6 +36,7 @@ module Storext
36
36
  end
37
37
 
38
38
  def set_storext_default_for(column, attr)
39
+ return unless self.respond_to?(column)
39
40
  if self.send(column).nil? || !self.send(column).has_key?(attr.to_s)
40
41
  write_store_attribute(column, attr, default_store_value(attr))
41
42
  end
@@ -1,3 +1,3 @@
1
1
  module Storext
2
- VERSION = "1.1.2"
2
+ VERSION = "2.0.0"
3
3
  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: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-09 00:00:00.000000000 Z
13
+ date: 2016-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.4.8
122
+ rubygems_version: 2.4.6
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Extends ActiveRecord::Store.store_accessor