aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xactionpack/lib/action_controller/base.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/object/misc.rb11
2 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index ab73e0ee86..52bddac092 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -861,7 +861,7 @@ module ActionController #:nodoc:
def self.view_class
@view_class ||=
# create a new class based on the default template class and include helper methods
- returning view_class = Class.new(ActionView::Base) do
+ returning Class.new(ActionView::Base) do |view_class|
view_class.send(:include, master_helper_module)
end
end
diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb
index 52c3773eea..ea8e3a1d6a 100644
--- a/activesupport/lib/active_support/core_ext/object/misc.rb
+++ b/activesupport/lib/active_support/core_ext/object/misc.rb
@@ -10,8 +10,17 @@ class Object #:nodoc:
#
# foo # => ['bar', 'baz']
#
+ # def foo
+ # returning [] do |values|
+ # values << 'bar'
+ # values << 'baz'
+ # end
+ # end
+ #
+ # foo # => ['bar', 'baz']
+ #
def returning(value)
- yield
+ yield(value)
value
end