You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above can currently be done using a transient property and some hooks, but it's kinda kludgy and hard to get right. Let's make this somewhat common case easier and less error prone.
FactoryBot.definedofactory:authordoassociation(:unique_article,relation: :has_many)do |user,offset|
title{"How to win, part #{offset + 1}"}# sets the title for the articleendendend
The text was updated successfully, but these errors were encountered:
This would be pretty great. If pursued, I would suggest the api look more like the current *[strategy]_list pattern rather than passing in a relation argument. That is:
association_list(:article,1)
I typically use a transient association count to avoid duplication & allow count overrides. Something like:
factory:authordotransientdoarticle_count{0}endarticlesdoArray.new(article_count){association:article,author: instance}endtrait:with_articledo# typically use this trait, but could pass in article_countarticle_count{1}endend
I'd like to be able to clearly, safely, and idiomatically create an object and its many relations. For example:
The above can currently be done using a transient property and some hooks, but it's kinda kludgy and hard to get right. Let's make this somewhat common case easier and less error prone.
It could look like this:
Or it could allow overrides:
The text was updated successfully, but these errors were encountered: