storext 2.1.0 → 2.2.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: ed9667630503a98f9776164696be4f842ebba6e5
4
- data.tar.gz: e456bb6a7b606c3ce742b5d4198e9437949d1cc1
3
+ metadata.gz: 80d98a4230700de78ec010083fb502a53c9cb9cd
4
+ data.tar.gz: bb9518e63fd7681d8b6b46e9317f8271a39efd20
5
5
  SHA512:
6
- metadata.gz: 7a580644af4c619ca2970783c22ccf8be3a2f75f4ee6cb6087dc3ce231ceded40f646cc4d5849bff40e973e74fafcf72fec6388f2dc2cfd0346270bee7e9f838
7
- data.tar.gz: d5c392574007beadb6175e19b16e026844656946afaab7aafbf7c7d134e5a4d10b4ef1056b0f81ccb9aaf0401db919a7d5a46e6da460ed24c71f33ca9ee1d65a
6
+ metadata.gz: 6aa6716b442fba708f71693412779a4bede8eab35aea283af194ca71cfbb8714e34fdd3af7502b988e8af8a8aacfa5896a7bf3e7d0f80b2dfb8d7972f5245475
7
+ data.tar.gz: b3bc66b25ae5fa34a2aae1e6381fb4da4c8a65e7f9c42d931e2ba50f41d8fe5ef08629dcbdac5831cbf46a83a48244b4c3a852f3a7a82d4f515bc4a3b7f6eb38
@@ -21,6 +21,13 @@ module Storext
21
21
  end
22
22
  end
23
23
 
24
+ def storext_define_predicater(column, attr)
25
+ define_method "#{attr}?" do
26
+ return false unless send(column) && send(column).has_key?(attr.to_s)
27
+ !!read_store_attribute(column, attr)
28
+ end
29
+ end
30
+
24
31
  def store_attribute(column, attr, type=nil, opts={})
25
32
  track_store_attribute(column, attr, type, opts)
26
33
  storext_check_attr_validity(attr, type, opts)
@@ -31,6 +38,7 @@ module Storext
31
38
  def storext_define_accessor(column, attr)
32
39
  storext_define_writer(column, attr)
33
40
  storext_define_reader(column, attr)
41
+ storext_define_predicater(column, attr)
34
42
  storext_define_proxy_attribute(attr)
35
43
  end
36
44
 
@@ -1,3 +1,3 @@
1
1
  module Storext
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.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: 2.1.0
4
+ version: 2.2.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-07-03 00:00:00.000000000 Z
13
+ date: 2016-08-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails