# Rails 2.0 Engines Plugin: belongs\_to Methods Not Working

**URL:** <https://www.ruby-forum.com/t/rails-2-0-engines-plugin-belongs-to-methods-not-working/127536>\
**Category:** Engines\
**Created:** [January 30, 2008, 5:06am UTC](https://www.ruby-forum.com/t/rails-2-0-engines-plugin-belongs-to-methods-not-working/127536 "2008-01-30T05:06:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratkins](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bcef8e/32.png) [@ratkins](https://www.ruby-forum.com/u/ratkins)\
**Post date:** [January 30, 2008, 5:06am UTC](https://www.ruby-forum.com/t/rails-2-0-engines-plugin-belongs-to-methods-not-working/127536/1 "2008-01-30T05:06:43Z")

</div>

* * *

Engine-Users mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org](http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org)

---

<div class="post-metadata">

**Author:** ![ratkins](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bcef8e/32.png) [@ratkins](https://www.ruby-forum.com/u/ratkins)\
**Post date:** [January 30, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/rails-2-0-engines-plugin-belongs-to-methods-not-working/127536/2 "2008-01-30T17:14:55Z")

</div>

I think the issue you’re describing is this - please correct me if I’m  
wrong:

- Savage beast contains a User class
- Your application is trying to re-open the User class to add methods to  
it
- However, when the application runs, none of your custom methods  
appear on the User class.

If this is the case, it sounds like a fairly common thing. The key is  
that model classes are not (at the moment) automatically mixed in the  
same way that Controllers and Helpers are.

Instead, you need to ensure that both the plugin class AND your  
application class is loaded. Your application’s class should be higher  
in the load path, so if you “require ‘user’”, it should be that  
app/models/user.rb will be loaded, but you can check this put putting  
some ‘puts’ statements in to check. If everything is as expected, you  
should then be able to explicitly require the user class from the  
Savage Beast plugin at the top of this file, and then re-open the  
class to add your methods.

It’s possible that the Savage Beast plugin references its own User  
class explicitly before you have the chance to load the one in your  
application - again, puts statements will shine a light on what’s  
going on behind the scenes.

James
