On Wed, Apr 8, 2009 at 6:40 PM, Jason Fox <[email protected]> wrote: > It seems to me that once the class has been defined either by the plugin > or by an initializer (it appears the initializer is loaded, then the > plugin, then the model), Rails will not allow any modifications to it. > Any additional thoughts?
You just figured out the problem by yourself :) 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. Once again, place that code into an initializer and you're done, but placing it under app/models won't work. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

