Skip to content

Instantly share code, notes, and snippets.

@veganstraightedge
Last active December 21, 2018 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veganstraightedge/c39efb0521e09fd0798a3e0323102732 to your computer and use it in GitHub Desktop.
Save veganstraightedge/c39efb0521e09fd0798a3e0323102732 to your computer and use it in GitHub Desktop.
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 \
--auto-correct
(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'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment