This rule was added in rubocop 1.79. We were inconsistent about it, so we're adding it to get more consistency.
21 lines
436 B
Ruby
21 lines
436 B
Ruby
class Admin::Poll::Questions::FormComponent < ApplicationComponent
|
|
include TranslatableFormHelper
|
|
include GlobalizeHelper
|
|
|
|
attr_reader :question, :url
|
|
use_helpers :can?
|
|
|
|
def initialize(question, url:)
|
|
@question = question
|
|
@url = url
|
|
end
|
|
|
|
private
|
|
|
|
def select_options
|
|
Poll.all.select { |poll| can?(:create, Poll::Question.new(poll: poll)) }.map do |poll|
|
|
[poll.name, poll.id]
|
|
end
|
|
end
|
|
end
|