Ruby on Rails Friday, March 28, 2014

On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis <waltd@wdstudio.com> wrote:

>> I have an external process changing the database of my app. Is there a good way to trigger the before save and after save filters for models that get updated, when it is an external process changing it?

> Try to think more about your overall application architecture. Maybe your "external process" can call an API in your Rails app instead of changing the database directly, behind its back.

+1 - this scenario has "data integrity fail" stamped all over it.

If you can't avoid having the external process write to the db, at least
have it write to *non-model* tables and incorporate the updates from
there (via periodic rake task, or whatever).

Good luck.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAFH-JiO7kMk29GF2%3DK3M_qiNhOmW45GpRLY3%2B8mbau%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment