storext 2.2.0 → 3.3.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
- SHA1:
3
- metadata.gz: 80d98a4230700de78ec010083fb502a53c9cb9cd
4
- data.tar.gz: bb9518e63fd7681d8b6b46e9317f8271a39efd20
2
+ SHA256:
3
+ metadata.gz: '08e312550d28c9b6fa6d53783037e1a5d40e86f9ae1ffe23a94d82978a65b6e1'
4
+ data.tar.gz: c8224c7d4f2a7fb41330ccb56511d0b23356c7ad9a107af40a515a2cbe85f48b
5
5
  SHA512:
6
- metadata.gz: 6aa6716b442fba708f71693412779a4bede8eab35aea283af194ca71cfbb8714e34fdd3af7502b988e8af8a8aacfa5896a7bf3e7d0f80b2dfb8d7972f5245475
7
- data.tar.gz: b3bc66b25ae5fa34a2aae1e6381fb4da4c8a65e7f9c42d931e2ba50f41d8fe5ef08629dcbdac5831cbf46a83a48244b4c3a852f3a7a82d4f515bc4a3b7f6eb38
6
+ metadata.gz: '08b86e1cf1ad26124c6f1922424ade4c9acc35ba368a1e4dc6d2ff254d4600d51ea9369429cd03d387844103698bf3e582b4b26eb23fc85d1a46637226fe0bec'
7
+ data.tar.gz: 0a6d04a5e40cb3fedf0de080c849714ee9796e7903e54dcc4c6bda0348ffdfa51e520d26ebc381eafb50dfa27dcd6ea373ed52545112c8805ecc5616aefea2a3
@@ -1,4 +1,4 @@
1
- Copyright 2016 G5
1
+ Copyright 2019 G5
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -24,7 +24,11 @@ module Storext
24
24
  def storext_define_predicater(column, attr)
25
25
  define_method "#{attr}?" do
26
26
  return false unless send(column) && send(column).has_key?(attr.to_s)
27
- !!read_store_attribute(column, attr)
27
+ if read_store_attribute(column, attr).is_a? String
28
+ !read_store_attribute(column, attr).blank?
29
+ else
30
+ !!read_store_attribute(column, attr)
31
+ end
28
32
  end
29
33
  end
30
34
 
@@ -76,6 +80,10 @@ module Storext
76
80
  end
77
81
  end
78
82
 
83
+ def _load(yml)
84
+ YAML.load(yml)
85
+ end
86
+
79
87
  private
80
88
 
81
89
  def storext_attrs_for(column)
@@ -7,6 +7,8 @@ module Storext
7
7
  new_value = send(column).dup
8
8
  end
9
9
  new_value.delete(attr.to_s)
10
+ storext_cast_proxy.reset_attribute(attr)
11
+
10
12
  send("#{column}=", new_value)
11
13
  end
12
14
 
@@ -15,7 +17,12 @@ module Storext
15
17
  if Rails.gem_version < Gem::Version.new("4.2.0")
16
18
  new_value = send(column).dup
17
19
  end
18
- attrs.each { |a| new_value.delete(a.to_s) }
20
+
21
+ attrs.each do |a|
22
+ new_value.delete(a.to_s)
23
+ storext_cast_proxy.reset_attribute(a)
24
+ end
25
+
19
26
  send("#{column}=", new_value)
20
27
  end
21
28
 
@@ -23,6 +30,10 @@ module Storext
23
30
  send(column).with_indifferent_access.has_key?(key)
24
31
  end
25
32
 
33
+ def _dump(level)
34
+ self.to_yaml
35
+ end
36
+
26
37
  private
27
38
 
28
39
  def set_storext_defaults
@@ -1,3 +1,3 @@
1
1
  module Storext
2
- VERSION = "2.2.0"
2
+ VERSION = "3.3.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.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - G5
@@ -10,10 +10,24 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-08-06 00:00:00.000000000 Z
13
+ date: 2021-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rails
16
+ name: virtus
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ - !ruby/object:Gem::Dependency
30
+ name: activerecord
17
31
  requirement: !ruby/object:Gem::Requirement
18
32
  requirements:
19
33
  - - ">="
@@ -21,7 +35,7 @@ dependencies:
21
35
  version: '4.0'
22
36
  - - "<"
23
37
  - !ruby/object:Gem::Version
24
- version: '6.0'
38
+ version: '6.2'
25
39
  type: :runtime
26
40
  prerelease: false
27
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,15 +45,15 @@ dependencies:
31
45
  version: '4.0'
32
46
  - - "<"
33
47
  - !ruby/object:Gem::Version
34
- version: '6.0'
48
+ version: '6.2'
35
49
  - !ruby/object:Gem::Dependency
36
- name: virtus
50
+ name: pg
37
51
  requirement: !ruby/object:Gem::Requirement
38
52
  requirements:
39
53
  - - ">="
40
54
  - !ruby/object:Gem::Version
41
55
  version: '0'
42
- type: :runtime
56
+ type: :development
43
57
  prerelease: false
44
58
  version_requirements: !ruby/object:Gem::Requirement
45
59
  requirements:
@@ -47,7 +61,7 @@ dependencies:
47
61
  - !ruby/object:Gem::Version
48
62
  version: '0'
49
63
  - !ruby/object:Gem::Dependency
50
- name: pg
64
+ name: rspec
51
65
  requirement: !ruby/object:Gem::Requirement
52
66
  requirements:
53
67
  - - ">="
@@ -61,7 +75,7 @@ dependencies:
61
75
  - !ruby/object:Gem::Version
62
76
  version: '0'
63
77
  - !ruby/object:Gem::Dependency
64
- name: rspec
78
+ name: database_cleaner
65
79
  requirement: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - ">="
@@ -75,7 +89,7 @@ dependencies:
75
89
  - !ruby/object:Gem::Version
76
90
  version: '0'
77
91
  - !ruby/object:Gem::Dependency
78
- name: database_cleaner
92
+ name: rails
79
93
  requirement: !ruby/object:Gem::Requirement
80
94
  requirements:
81
95
  - - ">="
@@ -124,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
138
  - !ruby/object:Gem::Version
125
139
  version: '0'
126
140
  requirements: []
127
- rubyforge_project:
128
- rubygems_version: 2.6.4
141
+ rubygems_version: 3.1.3
129
142
  signing_key:
130
143
  specification_version: 4
131
144
  summary: Extends ActiveRecord::Store.store_accessor