Коммит 2647d33b создал по автору Albert Salim's avatar Albert Salim
Просмотр файлов

Fix good example

владелец b53ef079
......@@ -4,22 +4,16 @@ module RuboCop
module Cop
# This cop prevents the use of feature flag in an ActiveRecord scope.
#
# bad:
# good:
# 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.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать