serializable_attributes 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/gemfiles/ar-3.2.gemfile +1 -1
- data/lib/serializable_attributes.rb +1 -1
- data/lib/serializable_attributes/schema.rb +3 -1
- data/serializable_attributes.gemspec +3 -2
- data/test/serialized_attributes_test.rb +1 -0
- metadata +37 -62
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9d745dbb204ad2b1dd0dd8d8c6f655170e0d312b
|
4
|
+
data.tar.gz: 696aba19f4b3aec3e1d29798b24bacaf2e8ae706
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d8b52f55c24bdc83e41fe2639715de1b7f90890295aa26b27b4d8c0ed5e700004fe2f51cc31bc9266ce41a4245ff0eeabb09c762c35e41edde5c9d76e1a0daaa
|
7
|
+
data.tar.gz: c65e6d27dd71fae0ff44169278628b63bc3b58e99f309b9b0645c0c43b60c34bab86e9761833fe4058ebd0b0eb1c7eb760db2e447225bafeef764c8c485380e5
|
data/Gemfile
ADDED
data/gemfiles/ar-3.2.gemfile
CHANGED
@@ -147,7 +147,9 @@ module SerializableAttributes
|
|
147
147
|
|
148
148
|
@model.before_save do |r|
|
149
149
|
schema = r.class.send("#{data_field}_schema")
|
150
|
-
r.send(
|
150
|
+
if r.send(blob_field).nil? || !r.send(changed_ivar).empty?
|
151
|
+
r.send("#{blob_field}=", schema.encode(r.send(data_field)))
|
152
|
+
end
|
151
153
|
end
|
152
154
|
end
|
153
155
|
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
## If your rubyforge_project name is different, then edit it and comment out
|
13
13
|
## the sub! line in the Rakefile
|
14
14
|
s.name = 'serializable_attributes'
|
15
|
-
s.version = '1.
|
16
|
-
s.date = '
|
15
|
+
s.version = '1.2.0'
|
16
|
+
s.date = '2013-12-03'
|
17
17
|
s.rubyforge_project = 'serializable_attributes'
|
18
18
|
|
19
19
|
## Make sure your summary is short. The description may be as long
|
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
40
40
|
# = MANIFEST =
|
41
41
|
s.files = %w[
|
42
|
+
Gemfile
|
42
43
|
LICENSE
|
43
44
|
README.md
|
44
45
|
Rakefile
|
@@ -111,6 +111,7 @@ formatters.each do |fmt|
|
|
111
111
|
test "ignores data with extra keys" do
|
112
112
|
@record.raw_data = self.class.format.encode(self.class.raw_hash.merge(:foo => :bar))
|
113
113
|
assert_not_nil @record.title # no undefined foo= error
|
114
|
+
@record.title = "changed" # force a change / rewrite
|
114
115
|
assert_equal false, @record.save # extra before_save cancels the operation
|
115
116
|
assert_equal self.class.raw_hash.merge(:active => 1).stringify_keys.keys.sort, self.class.format.decode(@record.raw_data).keys.sort
|
116
117
|
end
|
metadata
CHANGED
@@ -1,58 +1,45 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: serializable_attributes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 1.1.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Rick Olson
|
14
8
|
- Michael Guterl
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: activerecord
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 2
|
33
|
-
- 0
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
34
20
|
version: 2.2.0
|
35
21
|
- - <
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
hash: 11
|
38
|
-
segments:
|
39
|
-
- 3
|
40
|
-
- 3
|
41
|
-
- 0
|
22
|
+
- !ruby/object:Gem::Version
|
42
23
|
version: 3.3.0
|
43
24
|
type: :runtime
|
44
|
-
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 2.2.0
|
31
|
+
- - <
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.3.0
|
45
34
|
description: A bridge between using AR and a full blown schema-free db.
|
46
|
-
email:
|
35
|
+
email:
|
47
36
|
- technoweenie@gmail.com
|
48
37
|
- michael@diminishing.org
|
49
38
|
executables: []
|
50
|
-
|
51
39
|
extensions: []
|
52
|
-
|
53
40
|
extra_rdoc_files: []
|
54
|
-
|
55
|
-
|
41
|
+
files:
|
42
|
+
- Gemfile
|
56
43
|
- LICENSE
|
57
44
|
- README.md
|
58
45
|
- Rakefile
|
@@ -75,40 +62,28 @@ files:
|
|
75
62
|
- test/types_test.rb
|
76
63
|
homepage: http://github.com/technoweenie/serialized_attributes
|
77
64
|
licenses: []
|
78
|
-
|
65
|
+
metadata: {}
|
79
66
|
post_install_message:
|
80
67
|
rdoc_options: []
|
81
|
-
|
82
|
-
require_paths:
|
68
|
+
require_paths:
|
83
69
|
- lib
|
84
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
-
none: false
|
95
|
-
requirements:
|
96
|
-
- - ">="
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
hash: 17
|
99
|
-
segments:
|
100
|
-
- 1
|
101
|
-
- 3
|
102
|
-
- 5
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - '>='
|
78
|
+
- !ruby/object:Gem::Version
|
103
79
|
version: 1.3.5
|
104
80
|
requirements: []
|
105
|
-
|
106
81
|
rubyforge_project: serializable_attributes
|
107
|
-
rubygems_version:
|
82
|
+
rubygems_version: 2.0.3
|
108
83
|
signing_key:
|
109
84
|
specification_version: 2
|
110
85
|
summary: Store a serialized hash of attributes in a single ActiveRecord column.
|
111
|
-
test_files:
|
86
|
+
test_files:
|
112
87
|
- test/serialized_attributes_test.rb
|
113
88
|
- test/test_helper.rb
|
114
89
|
- test/types_test.rb
|