Project

General

Profile

Defect #33290 » 0001-stop-db-access-on-class-definition.patch

Kevin Fischer, 2020-04-15 10:44

View differences:

app/models/query.rb
self.name = name
self.sortable = options[:sortable]
self.groupable = options[:groupable] || false
if groupable == true
self.groupable = name.to_s
end
self.totalable = options[:totalable] || false
self.default_order = options[:default_order]
@inline = options.key?(:inline) ? options[:inline] : true
......
def css_classes
name
end
def group_by_statement
name.to_s
end
end
class TimestampQueryColumn < QueryColumn
def groupable
if @groupable
Redmine::Database.timestamp_to_date(sortable, User.current.time_zone)
end
def group_by_statement
Redmine::Database.timestamp_to_date(sortable, User.current.time_zone)
end
def group_value(object)
......
@cf = custom_field
end
def group_by_statement
@cf.group_statement
end
def caption
@cf.name
end
......
end
def group_by_statement
group_by_column.try(:groupable)
group_by_column.try(:group_by_statement)
end
def project_statement
(1-1/2)