"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/redmine/sort_criteria.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.

sort_criteria.rb  (redmine-4.1.0):sort_criteria.rb  (redmine-4.1.1)
skipping to change at line 93 skipping to change at line 93
s.collect {|c| append_order(c, o)} s.collect {|c| append_order(c, o)}
end end
end.flatten.compact end.flatten.compact
sql.blank? ? nil : sql sql.blank? ? nil : sql
end end
private private
def normalize! def normalize!
self.reject! {|s| s.first.blank? } self.reject! {|s| s.first.blank? }
self.uniq! {|s| s.first }
self.collect! {|s| s = Array(s); [s.first, (s.last == false || s.last.to_s == 'desc') ? 'desc' : 'asc']} self.collect! {|s| s = Array(s); [s.first, (s.last == false || s.last.to_s == 'desc') ? 'desc' : 'asc']}
self.replace self.first(3) self.replace self.first(3)
end end
# Appends ASC/DESC to the sort criterion unless it has a fixed order # Appends ASC/DESC to the sort criterion unless it has a fixed order
def append_order(criterion, order) def append_order(criterion, order)
if / (asc|desc)$/i.match?(criterion) if / (asc|desc)$/i.match?(criterion)
criterion criterion
else else
Arel.sql "#{criterion} #{order.to_s.upcase}" Arel.sql "#{criterion} #{order.to_s.upcase}"
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added

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