public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Updated Kernel#returning for the AP performance patch [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3991 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Sun Mar 19 20:37:32 -0800 2006
commit  eedd9d7604b6acbabb5d21fe20a87420bc07864c
tree    8eb300376beac857b15254f635cff38117afddee
parent  a4f1262ac5e55b3b373b5519f252aa8462d576fd
...
861
862
863
864
 
865
866
867
...
861
862
863
 
864
865
866
867
0
@@ -861,7 +861,7 @@ module ActionController #:nodoc:
0
       def self.view_class
0
         @view_class ||=
0
           # create a new class based on the default template class and include helper methods
0
- returning view_class = Class.new(ActionView::Base) do
0
+ returning Class.new(ActionView::Base) do |view_class|
0
             view_class.send(:include, master_helper_module)
0
           end
0
       end
...
10
11
12
 
 
 
 
 
 
 
 
 
13
14
 
15
16
17
...
10
11
12
13
14
15
16
17
18
19
20
21
22
 
23
24
25
26
0
@@ -10,8 +10,17 @@ class Object #:nodoc:
0
   #
0
   # foo # => ['bar', 'baz']
0
   #
0
+ # def foo
0
+ # returning [] do |values|
0
+ # values << 'bar'
0
+ # values << 'baz'
0
+ # end
0
+ # end
0
+ #
0
+ # foo # => ['bar', 'baz']
0
+ #
0
   def returning(value)
0
- yield
0
+ yield(value)
0
     value
0
   end
0
 

Comments

    No one has commented yet.