lib/motion-kit/helpers/base_layout.rb in motion-kit-0.14.2 vs lib/motion-kit/helpers/base_layout.rb in motion-kit-0.15.0
- old
+ new
@@ -125,11 +125,12 @@
# Blocks passed to `deferred` are run at the end of a "session", usually
# after a call to Layout#layout.
def deferred(context=nil, &block)
context ||= @context
- return parent_layout.add_deferred_block(context, &block)
+ parent_layout.add_deferred_block(context, &block)
+ return self
end
# Only intended for private use
def add_deferred_block(context, &block)
context ||= @context
@@ -138,11 +139,9 @@
end
raise InvalidDeferredError.new('deferred must be run inside of a context') unless context
raise ArgumentError.new('Block required') unless block
self.deferred_blocks << [context, block]
-
- self
end
# Only intended for private use
def deferred_blocks
@deferred_blocks ||= []