Closed dmitry-ilyashevich closed 5 years ago
Hi @dmitry-ilyashevich , thank you for pointing this out!
Let's polish a bit the PR and I'll merge it 👍
BTW, I bit misunderstand why the error is happening. I'll try to reproduce it.
@djezzzl I believe it fails with aliases because it try to find factory by name, not by one of the names https://github.com/djezzzl/factory_trace/pull/5/files#diff-3ed8df2bd98b9999e8ac5ca6e6787c7bL106
If you're out of time, I can merge as it is because you fix a problem and then can do small fixes myself.
WDYT?
@djezzzl My goal is to get this work, but I have some free time to polish. So any option is OK for me.
Okay, then the last thing I'd like to ask you is:
Check spec/factories.rb
file and your case there. Then you'll have some specs are failing but the main idea is to cover this situation for everything: processors/preprocessors/writers/readers/converts/trackers.
Then we're fully done 👍 Let me know if you'll try to do so. If not, I just merge and finish that part myself.
Well done 👍 I'll review and release it today.
@dmitry-ilyashevich Could you please have a look at this PR: https://github.com/djezzzl/factory_trace/pull/6. Try it for your project and say if it helps?
Support of indirect usage will be fixed in this branch soon https://github.com/djezzzl/factory_trace/tree/catch-indirectly-used-traits:
factory :post
factory :comment do
post
end
build(:comment) => # post is actually used, but for now it will be showed as not used
This spec shows it should help: https://github.com/djezzzl/factory_trace/pull/6/files#diff-84f01422b671cb52407e0b7a8518d309R25
Unused factory processor fails on factory aliases
Factory example to reproduce:
got: