lib/mutator/helpers.rb in mutator-0.0.2 vs lib/mutator/helpers.rb in mutator-0.1.0

- old
+ new

@@ -3,19 +3,19 @@ def machine @machine ||= machine_class.new(self) end def self.included(base) - "Mutator::#{base.name}".constantize.states.each do |state| + Mutator.const_get(base.name, false).states.each do |state| base.send(:define_singleton_method, state) do self.where(state: state) end end end protected def machine_class - "Mutator::#{self.class.name}".constantize + Mutator.const_get(self.class.name, false) end end end