Skip to content

Commit

Permalink
added generators
Browse files Browse the repository at this point in the history
  • Loading branch information
blindgaenger committed Feb 14, 2011
1 parent 98a0893 commit 2cd3be9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions generators/acts_as_account/acts_as_account_generator.rb
@@ -0,0 +1,7 @@
class ActsAsAccountGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "acts_as_account_migration"
end
end
end
9 changes: 9 additions & 0 deletions generators/acts_as_account/templates/migration.rb
@@ -0,0 +1,9 @@
class ActsAsAccountMigration < ActiveRecord::Migration
def self.up
load(File.dirname(__FILE__) + '../../../db/schema.rb')
end

def self.down
# TODO: add down migration, when schema.rb was replaced
end
end

0 comments on commit 2cd3be9

Please sign in to comment.