pluginaweek / state_machine

Adds support for creating state machines for attributes on any Ruby class
http://www.pluginaweek.org
MIT License
3.74k stars 507 forks source link

Fix `rake state_machine:draw` on namespace collisions #288

Closed rngtng closed 7 years ago

rngtng commented 10 years ago

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.

rngtng commented 7 years ago

closing dangling PR, as @obrie apparently abandoned the project. to bad :(