I have 3 tables in my rails app.
- User
- lnkUserPerson
- Person

User has\_one Person through lnkUserPerson & Person has\_one User through lnkUserPerson.

The lnkUserPerson table contains 3 fields 
- user\_fk which represents the id of the user
- person\_id, which represents the id of of that user in the Person table
- boss\_id, which represents the id of the user's boss in the Person table

To retrieve the user's details in the person table, am using: @user.lnkuserperson.person.name.

I would like to know how to retrieve the person details of the user's boss.

I tried using: 

```
@userBoss = Person.find(:first, :conditions => ["id = ?", @user.lnkuserperson.boss_id])

```

but when am trying to call it in my view, it's giving me an error.

I want to know to retrieve the boss details from the Person table by using the @user object.

---

User model:

```
has_one :lnkuserperson
has_one :person, :through => :lnkuserperson, :source=>:person
has_one :boss, :through => :lnkuserperson, :source=>:boss

```

Person model:

```
has_one :lnkuserperson
has_one :user, :through => :lnkuserperson

```

lnkuserperson model:

```
belongs_to :user
belongs_to :person, :class_name => "Person", :foreign_key => "person_id"
belongs_to :boss, :class_name => "Person", :foreign_key => "boss_id"

```

So to retrieve the boss details(in the e.g below am retrieving the name) of the user, i just call:

```
@user.lnkuserperson.boss.name

```