What do people who use SequelPro (and related tools) do to trigger their 
action filters usually?

Writing an API sounds ideal but what if you have little control over the 
tool.



On Friday, March 28, 2014 6:46:37 AM UTC-7, mike2r wrote:
>
>
>
> On Friday, March 28, 2014 8:47:24 AM UTC-4, Hassan Schroeder wrote:
>>
>> On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis <wa...@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.s...@gmail.com 
>> http://about.me/hassanschroeder 
>> twitter: @hassan 
>>
>
> agree with the data integrity concerns.  if it's possible, I think the API 
> solution above is the best option.  It is possible to write a batch 
> invocation of ActiveRecord which your external process would have to call, 
> but I think the cleanest way to insure all the before/after filters are 
> executed is by building an API.  
>
> If you're going to hit the database directly, at least push your model 
> constraints back into the database so that integrity is maintained.  That 
> still potentially leaves an issue with your before/after filters.  For 
> example, if you have an after filter that writes to a log/audit file after 
> a transaction is saved, that won't get executed.  Again, API would be the 
> cleanest and consistent with the way systems interface to each other.
>

-- 
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+unsubscr...@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/61df7399-4647-4c19-ad68-2c3cde7414d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to