Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…but provide user uninstall instructions
  • Loading branch information...
commit 464d0a98e42fe1085d3032cf1afb5abd22a60a7b 1 parent d64f948
@webandy webandy authored
View
2  generators/abingo_migration/templates/abingo_migration.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"
View
10 uninstall.rb
@@ -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'))
Please sign in to comment.
Something went wrong with that request. Please try again.