Search the web
Sign In
New User? Sign Up
RubyOnRails · Ruby on Rails
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Overriding Base.new   Message List  
Reply | Forward Message #98 of 107 |
Hello, I'm new in rails and I'm developing an application using it.
In one of my model classes I need to set an initial status when I
instantiate it. I override the new method like that:

def Iteration.new
super(:status => 'Não Iniciada')
end

but when in some tests I call the new method passing arguments, It
creates this error:
@iteration = Iteration.new(params[:iteration])

Error message:
test_save_failure(IterationsControllerTest):
ArgumentError: wrong number of arguments(1 for 0)

How can I override one method without ruby tring to override all of then?
Can anybody help me?
Thanks




Sat Jun 21, 2008 3:46 pm

bruno_sil
Offline Offline
Send Email Send Email

Forward
Message #98 of 107 |
Expand Messages Author Sort by Date

Hello, I'm new in rails and I'm developing an application using it. In one of my model classes I need to set an initial status when I instantiate it. I...
Bruno
bruno_sil
Offline Send Email
Jun 21, 2008
4:52 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help