##// END OF EJS Templates
Replaces find(:all) calls....
Jean-Philippe Lang -
r10689:96fca0b08f6d
parent child
Show More
@@ -67,14 +67,14 class ProjectsController < ApplicationController
67 end
67 end
68
68
69 def new
69 def new
70 @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
70 @issue_custom_fields = IssueCustomField.sorted.all
71 @trackers = Tracker.sorted.all
71 @trackers = Tracker.sorted.all
72 @project = Project.new
72 @project = Project.new
73 @project.safe_attributes = params[:project]
73 @project.safe_attributes = params[:project]
74 end
74 end
75
75
76 def create
76 def create
77 @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
77 @issue_custom_fields = IssueCustomField.sorted.all
78 @trackers = Tracker.sorted.all
78 @trackers = Tracker.sorted.all
79 @project = Project.new
79 @project = Project.new
80 @project.safe_attributes = params[:project]
80 @project.safe_attributes = params[:project]
@@ -107,7 +107,7 class ProjectsController < ApplicationController
107 end
107 end
108
108
109 def copy
109 def copy
110 @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
110 @issue_custom_fields = IssueCustomField.sorted.all
111 @trackers = Tracker.sorted.all
111 @trackers = Tracker.sorted.all
112 @source_project = Project.find(params[:id])
112 @source_project = Project.find(params[:id])
113 if request.get?
113 if request.get?
@@ -165,7 +165,7 class ProjectsController < ApplicationController
165 end
165 end
166
166
167 def settings
167 def settings
168 @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
168 @issue_custom_fields = IssueCustomField.sorted.all
169 @issue_category ||= IssueCategory.new
169 @issue_category ||= IssueCategory.new
170 @member ||= @project.members.new
170 @member ||= @project.members.new
171 @trackers = Tracker.sorted.all
171 @trackers = Tracker.sorted.all
@@ -43,7 +43,7 module RepositoriesHelper
43 end
43 end
44
44
45 def render_changeset_changes
45 def render_changeset_changes
46 changes = @changeset.filechanges.find(:all, :limit => 1000, :order => 'path').collect do |change|
46 changes = @changeset.filechanges.limit(1000).reorder('path').all.collect do |change|
47 case change.action
47 case change.action
48 when 'A'
48 when 'A'
49 # Detects moved/copied files
49 # Detects moved/copied files
@@ -88,7 +88,7 module TimelogHelper
88
88
89 def entries_to_csv(entries)
89 def entries_to_csv(entries)
90 decimal_separator = l(:general_csv_decimal_separator)
90 decimal_separator = l(:general_csv_decimal_separator)
91 custom_fields = TimeEntryCustomField.find(:all)
91 custom_fields = TimeEntryCustomField.all
92 export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
92 export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
93 # csv header fields
93 # csv header fields
94 headers = [l(:field_spent_on),
94 headers = [l(:field_spent_on),
@@ -30,6 +30,8 class CustomField < ActiveRecord::Base
30 validate :validate_custom_field
30 validate :validate_custom_field
31 before_validation :set_searchable
31 before_validation :set_searchable
32
32
33 scope :sorted, order("#{table_name}.position ASC")
34
33 CUSTOM_FIELDS_TABS = [
35 CUSTOM_FIELDS_TABS = [
34 {:name => 'IssueCustomField', :partial => 'custom_fields/index',
36 {:name => 'IssueCustomField', :partial => 'custom_fields/index',
35 :label => :label_issue_plural},
37 :label => :label_issue_plural},
General Comments 0
You need to be logged in to leave comments. Login now