Forum: Ruby on Rails Development Mode: Class reloading gone nuts!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bram W. (Guest)
on 2007-05-23 22:34
(Received via mailing list)
This is mostly that I've gone a bit crazy, but I'm looking for an
explanation of how class reloading works so I can try and debug this
issue....

I have a class...
class Event
    before_create :bootstrap_current_user
    def bootstrap_current_user
        ... saves the current user for this event...
     end
end

class FriendRequestEvent < Event
end

So, in development mode, when I hit my controller, it culminates in a:
FriendRequestEvent.create()

but, I'm getting an exception in development mode only...
NoMethodError: boostrap_current_user for <#FriendRequestEvent>

for what possible reason could this occur?  I'm thinking maybe it's
got the wrong parent class?  Or somewhere else there's an Event class
being reloaded, but without the method??
javier ramirez (Guest)
on 2007-05-23 22:40
(Received via mailing list)
hi,
> class Event
>     before_create :bootstrap_current_user
>     def bootstrap_current_user
>         ... saves the current user for this event...
>      end
> but, I'm getting an exception in development mode only...
> NoMethodError: boostrap_current_user for <#FriendRequestEvent>
>
I'm assuming you copy/pasted the code and error messages here. If so,
then your problem is your application seems to be looking for a
misspelled method BOOstrap_current_user, without the T. Just find for
that word in your code and you'll probably fix it.

regards,

javier ramirez
This topic is locked and can not be replied to.