I have a base class for a type of migration that occurs frequently:
class AddEventsBaseMigration < ActiveRecord::Migration
#ITEMS = []
def up
#add the items
end
def down
#remove the items that were added.
end
end
Then, when it's time to add new stuff, I create an inherited migration:
class AddEvents0930 < AddEventsBaseMigration
ITEMS = [ ... ]
end
When I try to run this migration, I get this error:
rake aborted!
uninitialized constant AddEventsBaseMigration
C:/.../Source/db/migrate/20131002152826_add_events_0930.rb:1
c:0:in `migrate'
Tasks: TOP => db:migrate:up
What am I doing wrong here?
Ruby: 1.8.7 (2013-06-27 patchlevel 374) [i386-mingw32]
Rails: 3.2.13
Edit: I forgot to mention that I've tried:
require "add_events_base_migration"
require "./add_events_base_migration"
require "/db/migrate/add_events_base_migration"
And I get the error: no such file to load -- /db/migrate/add_events_base_migration