MaurĂ­cio Linhares wrote:

Thanks again for the reply MaurĂ­cio.

> You just figured out the problem by yourself :)

I'm curious as to why it works if I paste the extended class definition 
into environment.rb.  I also found that if I include the following at 
the end of my environment.rb it works as I thought it might.  Do you 
know why this is an exception to the rule?

# config/environment.rb
require 'jason/my_class'

> If the class is already loaded, Rails will not try to load it again,
> no matter what you do, that's why I showed you the class_eval
> approach. Using class_eval (instead of directly "defining" a class)
> will make Rails try to load the class from somewhere else (that would
> be your plugin) and you woudn't have any method missing or class not
> being loaded issues.

I did try the class_eval approach, however, based on your comment, I was 
putting the code in the wrong spot.  I had placed the code into the 
app/models/my_class.rb.  I guess it needs to go into an initializer.  Do 
you know why that is?

Thanks again for the reply!
Jason
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to