The Method model is a container of conditions (triggers) and actions.
- A
Methodhas multipleCondition - Each
Conditionhas multipleAction
We can have different types of Condition, for instance:
- Order amount between
0and500USD - Order weight between
10and100pounds
And we can have different types of Action, for instance:
- Call supervisor ID
5 - Send email to
[email protected]
We are creating a table for each type of condition and a table for each type of action. That way we don't end up with a table full of columns to encompass each possible scenario.
The problem is: how to create this Polymorphic Relationship?
Starting with Conditions…
My database looks like:

