Browse files

remove the version append filename, don't remove the migration file, …

…but provide user uninstall instructions
  • Loading branch information...
webandy committed Jan 23, 2011
1 parent d64f948 commit 464d0a98e42fe1085d3032cf1afb5abd22a60a7b
Showing with 8 additions and 4 deletions.
  1. +1 −1 generators/abingo_migration/templates/abingo_migration.rb
  2. +7 −3 uninstall.rb
@@ -1,6 +1,6 @@
#Creates the two database tables, plus indexes, you'll need to use A/Bingo.
-class AbingoMigration<%= version -%> < ActiveRecord::Migration
+class AbingoMigration < ActiveRecord::Migration
def self.up
create_table "experiments", :force => true do |t|
t.string "test_name"
@@ -1,4 +1,8 @@
-# cleanup generated files
+# provide uninstall instructions to user
require 'fileutils'
-Dir.glob(File.join('db', 'migrate', '**')){|f| FileUtils.rm(f.grep(/_abingo_migration/)) }
-FileUtils.rm(File.join(Rails.root, 'public', 'stylesheets', 'abingo_dashboard.css'))
+migration_file = Dir.glob(File.join('db', 'migrate', '**')){|f| f.grep(/_abingo_migration/) }
+puts "Abingo migration file #{migration_file} has not been modified. Run the down method manually to reverse the migration."
+stylesheet = File.join(Rails.root, 'public', 'stylesheets', 'abingo_dashboard.css')
+puts "Removing the abingo dashboard stylesheet file: #{stylesheet}"
+FileUtils.rm(File.join(Rails.root, 'public', 'stylesheets', 'abingo_dashboard.css'))

0 comments on commit 464d0a9

Please sign in to comment.