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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---