Project

General

Profile

retrieve only the open issues

Added by v d over 10 years ago

I'm writing a plugin that retrieves a list of all open issues assigned to the logged in user.

I'm very new to RoR.

I have read through http://guides.rubyonrails.org/active_record_querying.html

Below is my query which works in the sense where it doesn't get the closed issues.

I would actually like it to link/look into the table "issue_statuses" and exclude all the issues with the statues that has been marked "is_closed" in the "issue_statues" table.

I'm assuming I do a join.

all_issues = Issue.where("status_id != 5")

Replies (1)

RE: retrieve only the open issues - Added by v d over 10 years ago

got it

all_issues = Issue.joins(:status).where("issue_statuses.is_closed != 1")
    (1-1/1)