@@ -35,19 +35,17 class FeedsController < ApplicationController | |||||
35 |
|
35 | |||
36 | # issue feeds |
|
36 | # issue feeds | |
37 | def issues |
|
37 | def issues | |
38 | conditions = nil |
|
38 | if @project && params[:query_id] | |
39 |
|
||||
40 | if params[:query_id] |
|
|||
41 | query = Query.find(params[:query_id]) |
|
39 | query = Query.find(params[:query_id]) | |
42 | # ignore query if it's not valid |
|
40 | # ignore query if it's not valid | |
43 | query = nil unless query.valid? |
|
41 | query = nil unless query.valid? | |
44 | conditions = query.statement if query |
|
42 | # override with query conditions | |
|
43 | @find_options[:conditions] = query.statement if query.valid? and @project == query.project | |||
45 | end |
|
44 | end | |
46 |
|
45 | |||
47 | Issue.with_scope(:find => @find_options) do |
|
46 | Issue.with_scope(:find => @find_options) do | |
48 | @issues = Issue.find :all, :include => [:project, :author, :tracker, :status], |
|
47 | @issues = Issue.find :all, :include => [:project, :author, :tracker, :status], | |
49 |
:order => "#{Issue.table_name}.created_on DESC" |
|
48 | :order => "#{Issue.table_name}.created_on DESC" | |
50 | :conditions => conditions |
|
|||
51 | end |
|
49 | end | |
52 | @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues)) |
|
50 | @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues)) | |
53 | headers["Content-Type"] = "application/rss+xml" |
|
51 | headers["Content-Type"] = "application/rss+xml" | |
@@ -55,20 +53,18 class FeedsController < ApplicationController | |||||
55 | end |
|
53 | end | |
56 |
|
54 | |||
57 | # issue changes feeds |
|
55 | # issue changes feeds | |
58 | def history |
|
56 | def history | |
59 | conditions = nil |
|
57 | if @project && params[:query_id] | |
60 |
|
||||
61 | if params[:query_id] |
|
|||
62 | query = Query.find(params[:query_id]) |
|
58 | query = Query.find(params[:query_id]) | |
63 | # ignore query if it's not valid |
|
59 | # ignore query if it's not valid | |
64 | query = nil unless query.valid? |
|
60 | query = nil unless query.valid? | |
65 | conditions = query.statement if query |
|
61 | # override with query conditions | |
|
62 | @find_options[:conditions] = query.statement if query.valid? and @project == query.project | |||
66 | end |
|
63 | end | |
67 |
|
64 | |||
68 | Journal.with_scope(:find => @find_options) do |
|
65 | Journal.with_scope(:find => @find_options) do | |
69 | @journals = Journal.find :all, :include => [ :details, :user, {:issue => [:project, :author, :tracker, :status]} ], |
|
66 | @journals = Journal.find :all, :include => [ :details, :user, {:issue => [:project, :author, :tracker, :status]} ], | |
70 |
:order => "#{Journal.table_name}.created_on DESC" |
|
67 | :order => "#{Journal.table_name}.created_on DESC" | |
71 | :conditions => conditions |
|
|||
72 | end |
|
68 | end | |
73 |
|
69 | |||
74 | @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues)) |
|
70 | @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues)) |
General Comments 0
You need to be logged in to leave comments.
Login now