Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing migration generation naming

  • Loading branch information...
commit d5b266fe2261e6d15cd20d36f3b513ff74a545d5 1 parent 7c55649
@kookster authored
View
17 lib/generators/say_when/migration/migration_generator.rb
@@ -1,13 +1,18 @@
+require 'rails/generators'
+require 'rails/generators/migration'
+require 'rails/generators/active_record/migration'
+
module SayWhen
class MigrationGenerator < Rails::Generators::Base
+
+ include Rails::Generators::Migration
+ extend ActiveRecord::Generators::Migration
+
+ source_root File.expand_path('../templates', __FILE__)
+
def manifest
- record do |m|
- m.migration_template 'migration.rb', 'db/migrate'
- end
+ migration_template 'migration.rb', 'db/migrate/create_say_when_tables'
end
- def file_name
- "say_when_migration"
- end
end
end
View
3  lib/generators/say_when/migration/templates/migration.rb
@@ -1,4 +1,5 @@
-class SayWhenMigration < ActiveRecord::Migration
+class CreateSayWhenTables < ActiveRecord::Migration
+
def self.up
create_table :say_when_jobs, :force => true do |t|
Please sign in to comment.
Something went wrong with that request. Please try again.