diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-22 19:07:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-22 19:07:43 +0000 |
commit | a17b62b455188208dccd38b312fb40d39c515757 (patch) | |
tree | 3e5573c29b01e33db6142bc42fd107d3e7746283 /app/controllers | |
parent | d84d38983ac7a5f56fcfd25f01fbf5b3d6d498c1 (diff) | |
download | redmine-a17b62b455188208dccd38b312fb40d39c515757.tar.gz redmine-a17b62b455188208dccd38b312fb40d39c515757.zip |
Fixes hard-coded table names in queries.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1692 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/timelog_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 605e7e61e..bf7b57d9d 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -55,14 +55,14 @@ class TimelogController < ApplicationController # Add list and boolean custom fields as available criterias @project.all_issue_custom_fields.select {|cf| %w(list bool).include? cf.field_format }.each do |cf| - @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM custom_values c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Issue' AND c.customized_id = issues.id)", + @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Issue' AND c.customized_id = #{Issue.table_name}.id)", :format => cf.field_format, :label => cf.name} end # Add list and boolean time entry custom fields TimeEntryCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf| - @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM custom_values c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'TimeEntry' AND c.customized_id = time_entries.id)", + @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'TimeEntry' AND c.customized_id = #{TimeEntry.table_name}.id)", :format => cf.field_format, :label => cf.name} end |