Class: RuboCop::Cop::FactoryBotGuide::DynamicAttributesForTimeAndRandom Deprecated

Inherits:
DynamicAttributeEvaluation show all
Defined in:
lib/rubocop/cop/factory_bot_guide/dynamic_attributes_for_time_and_random.rb

Overview

Deprecated.

Use DynamicAttributeEvaluation instead. This cop has been renamed to better reflect its broader scope.

Checks that method calls in FactoryBot attribute definitions are wrapped in blocks for dynamic evaluation.

This cop is deprecated and will be removed in a future release. Please use FactoryBotGuide/DynamicAttributeEvaluation instead.

Constant Summary collapse

MSG =

Override to provide deprecation warning with the old cop name

"Use block syntax for attribute `%<attribute>s` because `%<method>s` " \
"is evaluated once at factory definition time. " \
"Wrap in block: `%<attribute>s { %<value>s }`"

Constants inherited from DynamicAttributeEvaluation

RuboCop::Cop::FactoryBotGuide::DynamicAttributeEvaluation::RANDOM_CLASSES, RuboCop::Cop::FactoryBotGuide::DynamicAttributeEvaluation::TIME_CLASSES

Method Summary

Methods inherited from DynamicAttributeEvaluation

#attribute_assignment?, #factory_block?, #on_block