I have multiple models which have certain(same) action(let us call it
action1) to be performed on before_create, and other common
funcionallity.
Also in only certain model action2 is also to be performed.
class Model1
def before_create
#do action1
#do action2
end
#other commmon functionallity
end
class Model2
def before_create
#do action1
end
#other commmon functionallity
end
class Model3
def before_create
#do action1
end
#other commmon functionallity
end
Now action1 and 'other common functionallity" can be seperated into a
seperate module.
But what about “action2” in Model1.
If before_create was an event then a chain of event handeller could be
assigned. But before_create is a method. What to do?
Thanks,
Pankaj