summaryrefslogtreecommitdiffstats
path: root/app/models/query.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-04 21:00:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-04 21:00:59 +0000
commitbc3bd8aff2a7468a87211775be679b96e5c509dc (patch)
tree3b3895eff44e446b3903f38918446d8196451361 /app/models/query.rb
parent4cd67587ce338cee281ac01bc5144f5c839b74db (diff)
downloadredmine-bc3bd8aff2a7468a87211775be679b96e5c509dc.tar.gz
redmine-bc3bd8aff2a7468a87211775be679b96e5c509dc.zip
Let QueryColumn accept a Proc as caption (#18276).
git-svn-id: http://svn.redmine.org/redmine/trunk@13558 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r--app/models/query.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index a4d34d1e4..755c41db3 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -33,7 +33,14 @@ class QueryColumn
end
def caption
- @caption_key.is_a?(Symbol) ? l(@caption_key) : @caption_key
+ case @caption_key
+ when Symbol
+ l(@caption_key)
+ when Proc
+ @caption_key.call
+ else
+ @caption_key
+ end
end
# Returns true if the column is sortable, otherwise false