Module: Rein::View

Included in:
ActiveRecord::ConnectionAdapters::Mysql2Adapter, ActiveRecord::ConnectionAdapters::MysqlAdapter, ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
Defined in:
lib/rein/view.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) create_view(view_name, sql)



3
4
5
6
# File 'lib/rein/view.rb', line 3

def create_view(view_name, sql)
  sql = "CREATE VIEW #{view_name} AS #{sql}"
  execute(sql)
end

- (Object) drop_view(view_name)



8
9
10
11
# File 'lib/rein/view.rb', line 8

def drop_view(view_name)
  sql = "DROP VIEW #{view_name}"
  execute(sql)
end