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:
Javi Martín
2019-06-18 01:49:08 +02:00
parent 444fc524f7
commit fc1a89e966
17 changed files with 309 additions and 309 deletions

View File

@@ -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