Simplify new question form

In this form, the only case where `poll` might be present without
`question.poll` being present to is going to be the `new` action. We can
assign the poll in the `new` action and get rid of the `poll` variable
in the form.
This commit is contained in:
Javi Martín
2022-09-15 16:39:29 +02:00
parent d561a295e7
commit 4c8be42ea1
4 changed files with 5 additions and 7 deletions

View File

@@ -1,10 +1,9 @@
class Admin::Poll::Questions::FormComponent < ApplicationComponent
include TranslatableFormHelper
include GlobalizeHelper
attr_reader :poll, :question, :url
attr_reader :question, :url
def initialize(poll, question, url:)
@poll = poll
def initialize(question, url:)
@question = question
@url = url
end