Displaying 1 result from an estimated 1 matches for "scholarshipappl".
2010 Aug 10
4
(Dreaded) STI, belongs_to
...to apply for one of two
different types of school scholarships. Each scholarship goes through a
different review process, represented by a state machine (this is not a
state machine question). So there are two state machine classes that
differ slightly and subclass a generic StateMachine:
class ScholarshipApplication
belongs_to :state_machine
end
class StateMachine
end
class StateA < StateMachine
has_one :application
end
class StateB < StateMachine
has_one :application
end
The problem is I can get a ScholarshipApplication instance to tell me
its StateMachine, but the StateMachine can'...