Daniel Colson
Daniel Colson
I love that you are exploring this, but it seems difficult to reliably get the right method like this. For example: > all the enum scopes have a matching `not_...
Similar feelings to the other solutions so far. It's clever, but worries me a bit. Patching code in tests only can introduce subtle differences between tests and production. I'm also...
That approach makes sense to me. I think we could add `prefix` and `suffix` keyword arguments to the existing `traits_for_enum` method (see the second half of the [enum traits docs](https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#enum-traits))...
> if someone implements an api to extract _suffix and _prefix for enums in active_record, would you still like to merge #1513 I think #1513 is still worthwhile even if...
That is the expected behavior for `attributes_for`. It does not include attributes for associations. There has been some confusion about this in the past (see https://github.com/thoughtbot/factory_bot/issues/687, for example) so maybe...
It discards it because it is an association. The fact that the value is passed in as an override doesn't change how `attributes_for` behaves; it always uses the null strategy...
Yeah, I see your point. Thanks for that example.
Using private API involves some amount of risk that the private method will change unexpectedly, but we have taken that risk elsewhere in factory_bot (`defined_enums`, for example). `sql_type` seems fairly...
Thanks! Definitely worth exploring if we can inherit from BasicObject. I went down that path once with the DefinitionProxy (https://github.com/thoughtbot/factory_bot/pull/1144) and ended up turning back because it was going to...
This is an interesting one! It seems to be a bug related to association aliasing (factory_bot aliases `#{association}` and `#{association}_id`, and if one of those is passed in as an...