eBooru/app/inputs/boolean_input.rb
Earlopain fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00

14 lines
425 B
Ruby

# frozen_string_literal: true
class BooleanInput < SimpleForm::Inputs::BooleanInput
# Fix styling because the input appears before the label
def label_input(wrapper_options = nil)
# since boolean_style = :inline, the other mode doesn't need to be supported
if options[:label] == false || inline_label?
input(wrapper_options)
else
label(wrapper_options) + input(wrapper_options)
end
end
end