Skip to content

growkudos/trackless_triggers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= Trackless Triggers

Add triggers and functions to your active record migrations. Based on Trigger Happy (http://tenderlovemaking.com/2007/03/01/trigger-happy.html)

== INSTALL

Add this to your Gemfile:

gem 'trackless_triggers'

== EXAMPLE

Add a trigger:

  add_trigger "ai_people",
    :on         => 'people',
    :timing     => 'after',
    :event      => 'insert',
    :statement  => 'INSERT INTO log (id, timestamp) VALUES (NEW.id, NOW())'

Update an existing trigger (drops then adds):

  update_trigger "ai_people",
    :on         => 'people',
    :timing     => 'after',
    :event      => 'insert',
    :statement  => 'INSERT INTO log (id, timestamp) VALUES (NEW.id, NOW())'

Remove a trigger:

  drop_trigger 'ai_people'

== LIMITATIONS

Only works with mysql for now.


== Version 1.0.2, updated 2024-01-31

GrowKudos / Engineering team added support for Active Record 6.1

Packages

No packages published

Languages

  • Ruby 100.0%