vellam 0.1 → 0.1.1
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.
- data/README.md +1 -3
- data/lib/babel/hash_filter.rb +3 -2
- metadata +3 -2
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
[](http://travis-ci.org/mkristian/babel)
|
2
|
-
|
3
|
-
# babel #
|
1
|
+
# vellam [](http://travis-ci.org/mkristian/babel) #
|
4
2
|
|
5
3
|
rails comes with `to_json` and `to_xml` on models and you can give them an option map to control how the whole object tree gets serialized.
|
6
4
|
|
data/lib/babel/hash_filter.rb
CHANGED
@@ -106,12 +106,13 @@ module Babel
|
|
106
106
|
when Array
|
107
107
|
if include.include?(k)
|
108
108
|
models = model.send(k)
|
109
|
+
j = -1
|
109
110
|
case include
|
110
111
|
when Array
|
111
|
-
result[k] = v.
|
112
|
+
result[k] = v.collect { |i| j += 1; filter_data(models[j], i, &block) }
|
112
113
|
when Hash
|
113
114
|
opts = include[k]
|
114
|
-
result[k] = v.
|
115
|
+
result[k] = v.collect { |i| j += 1; filter_data(models[j], i, opts, &block) }
|
115
116
|
end
|
116
117
|
end
|
117
118
|
else
|
metadata
CHANGED