Открыть боковую панель
Захаров Дмитрий Сергеевич
Gitlab
Коммиты
2647d33b
Коммит
2647d33b
создал
Май 19, 2023
по автору
Albert Salim
Просмотр файлов
Fix good example
владелец
b53ef079
Изменения
1
Скрыть пробелы
Построчно
Рядом
rubocop/cop/feature_flag_in_scope.rb
Просмотр файла @
2647d33b
...
...
@@ -4,22 +4,16 @@ module RuboCop
module
Cop
# This cop prevents the use of feature flag in an ActiveRecord scope.
#
#
ba
d:
#
goo
d:
# class Meal < ApplicationRecord
# scope: with_fruits, -> do
# if Feature.enabled?(:with_apples)
# include(:apples)
# else
# include(:oranges)
# end
# end
# scope: with_apples, -> { include(:apples) }
# scope: with_oranges, -> { include(:oranges) }
# end
#
# good:
# if Feature.enabled?(:with_apples)
# Meal.
include(:
apples
)
# Meal.
with_
apples
# else
# Meal.
include(:
oranges
)
# Meal.
with_
oranges
# end
class
FeatureFlagInScope
<
RuboCop
::
Cop
::
Base
MSG
=
'Do not use feature flag in a ActiveRecord scope.'
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать