This PR fixes a problem of the state_machine:draw with namespace collisions.
Given:
class User; end # no state_machine
class Admin::User; end #includes state_machine
Running rake state_machine:draw CLASS=Admin::User will fail, as class resolves to User which doesn't have a statemachine defined. This PR fixes the klass resolving by disabling inheritance lookup of const_defined?. Added a fallback for older ruby version where this feature dosen't exist.
This PR fixes a problem of the
state_machine:draw
with namespace collisions.Given:
Running
rake state_machine:draw CLASS=Admin::User
will fail, as class resolves toUser
which doesn't have a statemachine defined. This PR fixes the klass resolving by disabling inheritance lookup ofconst_defined?
. Added a fallback for older ruby version where this feature dosen't exist.