eh, like so?
def after_create(model)
generate_hotel_param_files(model.id)
generate_hotel_setup_files(model.id)
end
def after_update(model)
generate_hotel_param_files(model.id)
generate_hotel_setup_files(model.id)
end
On Jul 21, 9:59 am, David Nguyen
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi,
> I have to make an observer if a modification is done on 3 differents
> classes
> Hotel, Server, ServerUser.
>
> class HotelObserver < ActiveRecord::Observer
> observe Hotel, Server, ServerUser
>
> def after_create(model)
> generate_hotel_param_files
> generate_hotel_setup_files
> end
>
> def after_update(model)
> generate_hotel_param_files
> generate_hotel_setup_files
> end
>
> ...
>
> I need to get the id (hotel id) to make my functions
> generate_hotel_param_files and generate_hotel_setup_files.
>
> is it possible to transmit this parameter to generate_hotel_param_files
> and
> generate_hotel_setup_files,
>
> is it possible to make 3 differents functions
> def after_create(hotel), def after_create(server), def
> after_create(userserver), or do I have to check model class
>
> How can I do that ?
>
> Thanks
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---