Hi All,

Today, when I debug, I found that I don't understand a very basic
function "super".


<code>

class User < ActiveRecord::Base
 def self.columns
   puts "here....................."
   @ret = super
   return @ret
 end

end
</code>



This return only one line of "here.....................". It is very
fine. However, when I called

My codes are:
<code>

class User < ActiveRecord::Base
 def self.columns
   puts "here....................."
   super
 end

end
</code>


The return is what I expected - a list of columns in User, but this
display 18 lines of "here....................." in the console (the
length of "columns" of my User is 17.


What is the difference between the two super call?

Thanks much!
Arthur
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to