Use find_by_slug_or_id! to find a poll
We were manually doing a similar thing - only we weren't raising an exception when we should.
This commit is contained in:
@@ -43,7 +43,7 @@ class PollsController < ApplicationController
|
||||
private
|
||||
|
||||
def load_poll
|
||||
@poll = Poll.find_by(slug: params[:id]) || Poll.find_by(id: params[:id])
|
||||
@poll = Poll.find_by_slug_or_id!(params[:id])
|
||||
end
|
||||
|
||||
def load_active_poll
|
||||
|
||||
Reference in New Issue
Block a user