Class: Multitenant::Views::SQL::Drop

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

Class Method Summary collapse

Class Method Details

.runObject



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

def self.run
  list = Multitenant::List.new
  list.sql = Multitenant::SQL::VIEWS

  list.to_a.each do |view|
    ActiveRecord::Base.connection.execute("DROP VIEW #{view};")
    p "==================== Dropped View: #{view} =================="
  end
end