Detecting when a record is saved

Hi all,

I have wrote a RoR app that analyzes results in a mysql database. Data
is input to the database with a java GUI. Is it possible to
automatically detect when new data is saved into the DB and then do
something?

Chris

try the after_save callback

You could put a timestamp on each record and then do a polling loop
looking for records newer than the last record you found previously.
That would detect the new records inserted by Java.

Michael

On Mar 20, 3:17 am, chris finch [email protected]

i misread the OP. sorry about that.

If MySQL supports triggers, you could create a DB trigger to execute a
Ruby script upon an insertion.

On Mar 20, 3:17 am, chris finch [email protected]