lib/connection_adapters/postgresql_adapter.rb
#     Add a trigger to a table
Add a trigger to a table
Add a trigger to a table
def add_trigger(table, events, options={})
        events += [:row]    if options.delete(:row)
        events += [:before] if options.delete(:before)
        trigger = TriggerDefinition.new(0, table, options[:name], events, options[:function])
        execute trigger.to_sql_create
      end
def add_trigger ( table , events , options = { } ) events += [ :row ] if options . delete ( :row ) events += [ :before ] if options . delete ( :before ) trigger = TriggerDefinition . new ( 0 , table , options [ :name ] , events , options [ :function ] ) execute trigger . to_sql_create end
Add a trigger to a table
Add a trigger to a table
table
<not_specific>
events
<not_specific>
options
<not_specific>