Feature #24013 » Symbols_instead_of_strings_to_support_firebird_keywords.patch
| app/models/issue.rb (date 1487076561000) | ||
|---|---|---|
|
if p.priority_derived?
|
||
|
# priority = highest priority of open children
|
||
|
# priority is left unchanged if all children are closed and there's no default priority defined
|
||
|
if priority_position = p.children.open.joins(:priority).maximum("#{IssuePriority.table_name}.position")
|
||
|
if priority_position = p.children.open.joins(:priority).select(IssuePriority.arel_table[:position].
|
||
|
maximum.as('maxi').to_sql).first[:maxi]
|
||
|
p.priority = IssuePriority.find_by_position(priority_position)
|
||
|
elsif default_priority = IssuePriority.default
|
||
|
p.priority = default_priority
|
||
| app/models/member.rb (date 1487076561000) | ||
|---|---|---|
|
# Sort by first role and principal
|
||
|
scope :sorted, lambda {
|
||
|
includes(:member_roles, :roles, :principal).
|
||
|
reorder("#{Role.table_name}.position").
|
||
|
merge(Role.order(:position)).
|
||
|
order(Principal.fields_for_order_statement)
|
||
|
}
|
||
|
scope :sorted_by_project, lambda {
|
||
| app/helpers/my_helper.rb (date 1487076561000) | ||
|---|---|---|
|
|
||
|
def issuesassignedtome_items
|
||
|
Issue.visible.open.
|
||
|
assigned_to(User.current).
|
||
|
limit(10).
|
||
|
includes(:status, :project, :tracker, :priority).
|
||
|
references(:status, :project, :tracker, :priority).
|
||
|
order("#{IssuePriority.table_name}.position DESC, #{Issue.table_name}.updated_on DESC")
|
||
|
assigned_to(User.current).
|
||
|
limit(10).
|
||
|
includes(:status, :project, :tracker, :priority).
|
||
|
references(:status, :project, :tracker, :priority).
|
||
|
merge(IssuePriority.reorder(:position => :desc)).merge(Issue.order(:updated_on => :desc))
|
||
|
end
|
||
|
|
||
|
def issuesreportedbyme_items
|
||
|
Issue.visible.open.
|
||
|
where(:author_id => User.current.id).
|
||
|
limit(10).
|
||
|
includes(:status, :project, :tracker).
|
||
|
references(:status, :project, :tracker).
|
||
|
order("#{Issue.table_name}.updated_on DESC")
|
||
|
where(:author_id => User.current.id).
|
||
|
limit(10).
|
||
|
includes(:status, :project, :tracker).
|
||
|
references(:status, :project, :tracker).
|
||
|
order(:updated_on => :desc)
|
||
|
end
|
||
|
|
||
|
def issueswatched_items
|
||
| ... | ... | |
|
limit(10).
|
||
|
includes(:project, :author).
|
||
|
references(:project, :author).
|
||
|
order("#{News.table_name}.created_on DESC").
|
||
|
order(:created_on => :desc).
|
||
|
to_a
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
joins(:activity, :project).
|
||
|
references(:issue => [:tracker, :status]).
|
||
|
includes(:issue => [:tracker, :status]).
|
||
|
order("#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC").
|
||
|
order(:spent_on => :desc).merge(Project.order(:name)).merge(Tracker.order(:position)).merge(Issue.order(:id)).
|
||
|
to_a
|
||
|
|
||
|
return entries, days
|
||
| app/controllers/versions_controller.rb (date 1487076561000) | ||
|---|---|---|
|
includes(:project, :tracker).
|
||
|
preload(:status, :priority, :fixed_version).
|
||
|
where(:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)).
|
||
|
order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
|
||
|
merge(Project.order(:lft)).merge(Tracker.order(:position)).merge(Issue.order(:id))
|
||
|
@issues_by_version = issues.group_by(&:fixed_version)
|
||
|
end
|
||
|
@versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?}
|
||
| ... | ... | |
|
@issues = @version.fixed_issues.visible.
|
||
|
includes(:status, :tracker, :priority).
|
||
|
preload(:project).
|
||
|
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||
|
merge(Tracker.order(:position)).merge(Issue.order(:id)).references(:tracker).
|
||
|
to_a
|
||
|
}
|
||
|
format.api
|
||
| lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb (date 1487076561000) | ||
|---|---|---|
|
return if self.included_modules.include?(Redmine::Acts::Customizable::InstanceMethods)
|
||
|
cattr_accessor :customizable_options
|
||
|
self.customizable_options = options
|
||
|
has_many :custom_values, lambda {includes(:custom_field).order("#{CustomField.table_name}.position")},
|
||
|
has_many :custom_values, lambda {includes(:custom_field).merge(CustomField.order(:position))},
|
||
|
:as => :customized,
|
||
|
:inverse_of => :customized,
|
||
|
:dependent => :delete_all,
|
||