"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/models/query.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

query.rb  (redmine-4.1.0):query.rb  (redmine-4.1.1)
skipping to change at line 845 skipping to change at line 845
def sort_clause def sort_clause
if clause = sort_criteria.sort_clause(sortable_columns) if clause = sort_criteria.sort_clause(sortable_columns)
clause.map {|c| Arel.sql c} clause.map {|c| Arel.sql c}
end end
end end
# Returns the SQL sort order that should be prepended for grouping # Returns the SQL sort order that should be prepended for grouping
def group_by_sort_order def group_by_sort_order
if column = group_by_column if column = group_by_column
order = (sort_criteria.order_for(column.name) || column.default_order || ' asc').try(:upcase) order = (sort_criteria.order_for(column.name) || column.default_order || ' asc').try(:upcase)
Array(column.sortable).map {|s| Arel.sql("#{s} #{order}")}
column_sortable = column.sortable
if column.is_a?(TimestampQueryColumn)
column_sortable = Redmine::Database.timestamp_to_date(column.sortable, U
Array(column_sortable).map {|s| Arel.sql("#{s} #{order}")}
end end
end end
# Returns true if the query is a grouped query # Returns true if the query is a grouped query
def grouped? def grouped?
!group_by_column.nil? !group_by_column.nil?
end end
def group_by_column def group_by_column
groupable_columns.detect {|c| c.groupable && c.name.to_s == group_by} groupable_columns.detect {|c| c.groupable && c.name.to_s == group_by}
skipping to change at line 917 skipping to change at line 922
if v.delete("me") if v.delete("me")
if User.current.logged? if User.current.logged?
v.push(User.current.id.to_s) v.push(User.current.id.to_s)
v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id' v += User.current.group_ids.map(&:to_s) if field == 'assigned_to_id'
else else
v.push("0") v.push("0")
end end
end end
end end
if field == 'project_id' || (self.type == 'ProjectQuery' && field == 'id') if field == 'project_id' || (self.type == 'ProjectQuery' && %w[id parent_i d].include?(field))
if v.delete('mine') if v.delete('mine')
v += User.current.memberships.map(&:project_id).map(&:to_s) v += User.current.memberships.map(&:project_id).map(&:to_s)
end end
if v.delete('bookmarks') if v.delete('bookmarks')
v += User.current.bookmarked_project_ids v += User.current.bookmarked_project_ids
end end
end end
if field =~ /^cf_(\d+)\.cf_(\d+)$/ if field =~ /^cf_(\d+)\.cf_(\d+)$/
filters_clauses << sql_for_chained_custom_field(field, operator, v, $1, $2) filters_clauses << sql_for_chained_custom_field(field, operator, v, $1, $2)
 End of changes. 2 change blocks. 
2 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)