Class: CreateNivoTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/rails/generators/nivo/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



7
8
9
10
11
# File 'lib/rails/generators/nivo/templates/migration.rb', line 7

def self.down
  drop_table :slides
  item = CmsMenuItem.find_by_title("Slides")
  item.destroy
end

.upObject



2
3
4
5
# File 'lib/rails/generators/nivo/templates/migration.rb', line 2

def self.up
  SCHEMA_AUTO_INSERTED_HERE
  CmsMenuItem.create({:title =>"Slides", :controller_name => "nivo/slides", :url => "/nivo/slides"})
end