rabl 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Rabl
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Esquenazi