James L. wrote:
On 5/22/06, Eric N. email@example.com wrote:
i_d.month calls get reached when i_d is nil?
What makes you think that i_d.month is blowing up? Wouldn’t it be
more likely that comp_dates.first is causing problems?
Do you have some logs to go along with this? Knowing what you’re
doing on your console would help too.
The trace from the web page:
line 25 in competition.rb is the i_d.month line
the other aspect is the error message:
“You have a nil object when you didn’t expect it!
The error occured while evaluating nil.month”
the only place where I’m calling month, is in this function.
From the console: I’ve done:
comps = Competition.find :all, :include=>:comp_dates
and this generates “real” output and no errors.
The code that the WEBrick server is executing in to reach the error :
class RegisterController < ApplicationController
@competitions = Competition.find :all, :include=>:comp_dates
---- IN list.rhtml
<% for competition in @competitions -%>
|<%= competition.display_dates -%>
<% end -%>