Agilefreaks / Aquarium

An AOP library for Ruby
https://rubygems.org/gems/aquarium/
148 stars 24 forks source link

Use Aquarium in a Rails project to display Notifications #30

Closed ntenisOT closed 13 years ago

ntenisOT commented 13 years ago

Hello guys,

I would like to ask if it is possible to use AOP programming in Rails to display Notifications to the users.

For example:

Before or after saving a user in the db show a notification popup that a new account is created

or

Before or after updating a user in the db show a notification popup that a new account is update

Can someone provide an example if that is posible?

Thanks in advance.

deanwampler commented 13 years ago

You could do this, but Rails already offers before and after methods that could be used to do the same sort of thing. I recommend using those, because they also modify Object like Aquarium does and you might run into a collision between the monkey patches.