Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DEPRECATION WARNING: Static attributes will be removed in FactoryBot 5.0. Please use dynamic
attributes instead by wrapping the attribute value in a block:
alias { "orders" }
To automatically update from static attributes to dynamic ones,
install rubocop-rspec and run:
rubocop --require rubocop-rspec \
--only FactoryBot/AttributeDefinedStatically \
(called from block (3 levels) in <top (required)> at .../spec/factories/foo_factory.rb:6)
FactoryBot.define do
factory :foo do
trait :from_orders do
type { 'FROM' }
attrs { {} }
add_attribute :alias, 'orders'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.