Module: Viewmatic::Migration

Defined in:
lib/viewmatic/migration.rb

Overview

Helpers for creating and dropping views in ActiveRecord migrations.

Instance Method Summary collapse

Instance Method Details

#create_view(name) ⇒ Object

Create the view named in “name”. It must be defined in the view definitions file.

Parameters:

  • name (Symbol)


11
12
13
# File 'lib/viewmatic/migration.rb', line 11

def create_view(name)
  execute SchemaStatements.create_view Viewmatic.view name
end

#drop_view(name) ⇒ Object

Drop the view named in “name”. It must be defined in the view definitions file.

Parameters:

  • name (Symbol)


20
21
22
# File 'lib/viewmatic/migration.rb', line 20

def drop_view(name)
  execute SchemaStatements.drop_view Viewmatic.view name
end