X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/46f924b34b305d2474b09ce204a7a9187e8d8622..c992f015ed80cab29bd0f4b6cdd0ddbc1d00d304:/app/models/quick_vote.rb 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