Find_by_name won't return record id

Okay - so I’m finally making my first post after a couple of months
with RoR. Thanks for all the great information so far.

I’m using mysql. I have a model called “Role”. I’m trying to retrieve
the id for a record that has name = “Admin”. From the Ruby console:

Role.find_by_name(“Admin”)
=> #<Role id: 233, created_at: “2008-07-21 12:55:27”, updated_at:
“2008-07-21 12:55:27”, name: “Admin”>

Role.find_by_name(“Admin”).name
=> “Admin”

Role.find_by_name(“Admin”).id
=> nil

As you can see, Role.find_by_name(“Admin”) returns a record with id:
233.

So, why does Role.find_by_name(“Admin”).id return nil?

If I go into MySQL Query Browser, I can do SELECT id FROM roles WHERE
name = “Admin” and I get back “233” - everything’s groovy.

I’m sure I’m doing something dorky - apologies in advance…

UGH. Totally dumb.

My Role model had:

def id
end

Thus, overriding the accessor. Not sure how that got there - but,
problem solved.