Customizing belongs_to method

Hi you all,
I'm working with a legacy database that has:
- id: primary key.
- dirip: IP address.
-dirip: IP address (foreign key referring to User)
A user can have generated many bugs, and a bug belongs to one user.
However, as you can see, Bugs.dirip refers to User.dirip, not
(cause dirip is also unique, and the db creators thought this would be

So, in the belongs_to declaration in Bugs, I can change the foreign_key
namebut... how can I say that this foreign key is not referring to in the belongs_to declaration???
If I can't change that, I have to override the user.bugs method and
bug.user method, implementing mine, am I right?


One way might be to declare dirip as the primary key for User. I'd
hate to have to do that (use external data for a key), but it's "a