Skip to content

Commit ebe0d70

Browse files
author
waleedjaffar
committed
fixes #70, Authorization problem
1 parent b9a8507 commit ebe0d70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/controllers/charts_burndown2_controller.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ChartsBurndown2Controller < ChartsController
55
protected
66

77
def get_data
8-
@conditions[:fixed_version_ids] ||= get_current_fixed_version_in(@project.id)
8+
@conditions[:fixed_version_ids] ||= get_current_fixed_version_in(@project)
99

1010
version = unless @conditions[:fixed_version_ids].empty?
1111
Version.first(:conditions => {:id => @conditions[:fixed_version_ids][0]})
@@ -183,15 +183,15 @@ def get_multiconditions_options
183183

184184
private
185185

186-
def get_current_fixed_version_in(project_id)
187-
version = Version.all(:conditions => {:project_id => project_id}).detect do |version|
186+
def get_current_fixed_version_in(project)
187+
version = Version.all(:conditions => {:project_id => project.id}).detect do |version|
188188
version.created_on.to_date <= Date.current && !version.effective_date.nil? && version.effective_date >= Date.current
189189
end
190190
if version
191191
[version.id]
192192
else
193-
versions = RedmineCharts::ConditionsUtils.to_options([:fixed_version_ids])[:fixed_version_ids]
194-
unless versions.empty?
193+
versions = RedmineCharts::ConditionsUtils.to_options(project, [:fixed_version_ids])[:fixed_version_ids]
194+
unless versions.nil? || versions.empty?
195195
[versions.first[1]]
196196
else
197197
[]

0 commit comments

Comments
 (0)