diff options
author | Jochen Topf <jochen@topf.org> | 2010-11-10 08:12:18 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2010-11-10 08:12:18 +0100 |
commit | c44b109b1740cd9e58bd8d0640391e2435ebfdea (patch) | |
tree | c61575af9e0cf86be338e2d92c8d55d799172423 /web/lib | |
parent | 5b2e986a24e4d51c3103b257516cff758d087cbf (diff) | |
download | taginfo-c44b109b1740cd9e58bd8d0640391e2435ebfdea.tar taginfo-c44b109b1740cd9e58bd8d0640391e2435ebfdea.tar.gz |
Cleanup
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/reports.rb | 2 | ||||
-rw-r--r-- | web/lib/test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/web/lib/reports.rb b/web/lib/reports.rb index f3f363c..3412a8b 100644 --- a/web/lib/reports.rb +++ b/web/lib/reports.rb @@ -5,7 +5,7 @@ attr_reader :title, :sources def self.reports - @@reports.sort{ |a,b| a.title <=> b.title } + @@reports.sort_by{ |report| report.title } end def initialize(title, sources) diff --git a/web/lib/test.rb b/web/lib/test.rb index fdd36b9..6d59e2b 100644 --- a/web/lib/test.rb +++ b/web/lib/test.rb @@ -14,7 +14,7 @@ class Taginfo < Sinatra::Base @tags = @db.select("SELECT key, count, (count - ?) / (? - ?) AS scale, in_wiki, in_josm FROM popular_keys ORDER BY count DESC LIMIT #{limit}", @min.to_f, @max, @min). execute(). each_with_index{ |tag, idx| tag['pos'] = (limit - idx) / limit.to_f }. - sort{ |a,b| a['key'] <=> b['key'] } + sort_by{ |row| row['key'] } erb :'test/tags' end |