Fork me on GitHub
Noah Bogart23:03:13

Façaí looks really good and without actually using it seems like it covers all of the base cases. I appreciate the inclusion of traits, which is one of my favorite features in factory_bot. It seems that traits currently are just alternatives to specified columns in the factory. In fb, they’re a specific context that allows for more complex logic, such as embedding/calling other traits or referencing before/after handlers (which i know isn't part of facai yet). Any plans to implement that logic?


I'll have to look into that. Got any pointers or good examples?

Noah Bogart14:03:34 is the full guide so you can cross reference, but here’s a simple example of a trait referencing another trait:

factory :order do
  trait :completed do
    completed_at { 3.days.ago }

  trait :refunded do
    refunded_at { }

Noah Bogart15:03:47

I would be willing to implement this and/or other factory_bot-style functionality, if you're interested


Help would definitely be appreciated, but let's then make sure we agree on how it should behave in terms of API. Maybe start with creating an issue for discussion?

👍 1
Noah Bogart16:04:51 there you go. I wrote that on my phone so hopefully it's legible.