BuDen
BuDen

Reputation: 927

catch MySql trigger on the activerecord level

I develop project on Ruby using Rails4. I have two mysql tables A and B, also I have MySql trigger which update column value of B table when I update column from A table, using for example MySql client, not by backend. Can I catch update event of B table on the backend using activerecord or anything else solution? Thanks.

Upvotes: 0

Views: 150

Answers (1)

bluehallu
bluehallu

Reputation: 10275

You can't. Triggers don't produce exceptions or anything else that you can catch from a higher level.

Embedding logic into the database is against "the Rails way", which would have been to use the Model to set up such operations, by the way.

Upvotes: 1

Related Questions