Class: Multitenant::Triggers::SQL::Drop

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/multitenant/triggers/sql/drop.rb

Class Method Summary collapse

Class Method Details

.runObject



10
11
12
13
14
15
16
17
# File 'lib/generators/multitenant/triggers/sql/drop.rb', line 10

def self.run
  list = Multitenant::List.new
  list.sql = Multitenant::SQL::TRIGGERS
  list.to_a.each do |trigger|
    ActiveRecord::Base.connection.execute("DROP TRIGGER #{trigger};")
    p "==================== Dropped Trigger: #{trigger} =================="
  end
end