X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/7ee8e40628f6d7b775f48d859dd005de5a5e9afa..ee900b07e68ccad333d94c0cc322dcca289349a5:/app/models/quick_vote.rb?ds=inline diff --git a/app/models/quick_vote.rb b/app/models/quick_vote.rb index 6259784..5f566c6 100644 --- a/app/models/quick_vote.rb +++ b/app/models/quick_vote.rb @@ -74,4 +74,15 @@ class QuickVote < Election end + + ### Convert a shortname or id into a QuickVote + def self.ident_to_quickvote(ident) + if ident.match(/^\d+$/) + quickvote = QuickVote.find(ident) + else + quickvote = QuickVote.find_all(["name = ?", ident])[0] + end + + return quickvote + end end