mccraigmccraig-better_serialization 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/better_serialization.rb +6 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/better_serialization.rb
CHANGED
@@ -115,8 +115,14 @@ module BetterSerialization
|
|
115
115
|
define_method attribute do
|
116
116
|
JsonSerializer.new(options).from_json(self[attribute])
|
117
117
|
end
|
118
|
+
|
119
|
+
(@json_serialized_attributes||={})[attribute.to_s]=options
|
118
120
|
end
|
119
121
|
end
|
122
|
+
|
123
|
+
def json_serialized_attributes
|
124
|
+
@json_serialized_attributes || {}
|
125
|
+
end
|
120
126
|
end
|
121
127
|
|
122
128
|
class ActiveRecord::Base
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mccraigmccraig-better_serialization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- http://github.com/crystalcommerce
|