rabl 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rabl/builder.rb +2 -2
- data/lib/rabl/engine.rb +1 -1
- data/lib/rabl/version.rb +1 -1
- metadata +3 -3
data/lib/rabl/builder.rb
CHANGED
@@ -74,7 +74,7 @@ module Rabl
|
|
74
74
|
return false unless data.present?
|
75
75
|
object = data_object(data)
|
76
76
|
glued_attributes = self.object_to_hash(object, &block)
|
77
|
-
@_result.merge!(glued_attributes)
|
77
|
+
@_result.merge!(glued_attributes) if glued_attributes
|
78
78
|
end
|
79
79
|
|
80
80
|
# Extends an existing rabl template with additional attributes in the block
|
@@ -82,7 +82,7 @@ module Rabl
|
|
82
82
|
def extends(file, options={}, &block)
|
83
83
|
options = options.merge(:object => @_object)
|
84
84
|
result = @options[:engine].partial(file, options, &block)
|
85
|
-
@_result.merge!(result)
|
85
|
+
@_result.merge!(result) if result
|
86
86
|
end
|
87
87
|
|
88
88
|
protected
|
data/lib/rabl/engine.rb
CHANGED
@@ -23,7 +23,7 @@ module Rabl
|
|
23
23
|
# Sets the object to be used as the data source for this template
|
24
24
|
# object(@user)
|
25
25
|
def object(data)
|
26
|
-
@_object = data
|
26
|
+
@_object = data unless @_locals[:object]
|
27
27
|
end
|
28
28
|
|
29
29
|
# Indicates an attribute or method should be included in the json output
|
data/lib/rabl/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Esquenazi
|