Use dynamic attributes in factories
Static attributes are deprecated since factory bot 4.11; we haven't upgraded yet but now we're ready to do so: https://thoughtbot.com/blog/deprecating-static-attributes-in-factory_bot-4-11
This commit is contained in:
@@ -2,7 +2,7 @@ FactoryBot.define do
|
||||
factory :vote do
|
||||
association :votable, factory: :debate
|
||||
association :voter, factory: :user
|
||||
vote_flag true
|
||||
vote_flag { true }
|
||||
after(:create) do |vote, _|
|
||||
vote.votable.update_cached_votes
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user