gocardless / statesman

A statesmanlike state machine library.
https://gocardless.com/blog/statesman/
MIT License
1.78k stars 163 forks source link

`check_missing_methods!` method not working as intended #369

Closed NGMarmaduke closed 5 years ago

NGMarmaduke commented 5 years ago

Currently the check_missing_methods! on active_record_queries.rb looks like:

https://github.com/gocardless/statesman/blob/b7e1a9c92884d90def039a22176a2da771c04e20/lib/statesman/adapters/active_record_queries.rb#L5-L7

This issue line being:

reject { |_method| base.respond_to?(:method) } 

All ruby classes will respond to the method method, and therefore this predicate will never return false. This results in the guard always returning early and therefore the subsequent error is never raised.

Presumable the check should look something like:

reject { |method| base.respond_to?(method) } 

I'm happy to PR when I have time

danwakefield commented 5 years ago

Thanks for raising this issue. https://github.com/gocardless/statesman/pull/364 should solve this. I'll poke the authors today and check when they'll finish it.