Hello champs,

Scenario is that i have a table called "employee" and a column for
manager_id inside it.. and another table called "leaves" and having a
column employee_id inside it.. I am copying here one record..

Employee table-
id employee_name manager_id created_at ..
1  hemant        1          whatever
2  hemant        1          whatever

Leave table-
id employee_id   status      created_at ..
1  1             pending     whatever
2  2             granted     whatever

Now i want to find out all the leave records of an employee whose
manager id is session id.. like i logged in using employee_id = 1, then
is should show me all leaves of employee whose manager id = 1..

Hope you people got me right, may be a one liner only .. :)
-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to