Forum: Ruby on Rails Bye-bye, Observers

Posted by Svoop (Guest)
on 2012-12-06 08:46
(Received via mailing list)
Hiya

No more observers in Rails 4, farewell, never been much of a fan anyway.

However, one of my gems is enabling model attributes for use with a
client-side WYSIWYM editor. The sanitized markup ends up in the database
and has to be processed before shown in a view. The corresponding helper
does fragment caching. This cache has to be zapped when the model is
modified or deleted. And since the gem is generic, an observer for
"after_update" "after_destroy" seemed the obvious choice for this.

What would be the Rails 4 state of the art approach do do this without
using observers? Inject the above callbacks into the model directly?

-sven
Posted by "Rodrigo Mendonça" <denoww@gmail.com> (Guest)
on 2012-12-07 12:43
(Received via mailing list)
Observers will be removed from rails 4, but will be possible use them 
with
gem

2012/12/5 Svoop <sven.schwyn@gmail.com>

>
> rubyonrails-talk+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-....
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



--
Rodrigo Mendona
(62) 8567-3142
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.