[fixes #12] make sure we use Thor style source_root for migration generator - reportable - Fork of reportable required by WarVox, from hdm/reportable.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit dcdedace51280ef73a205161881a4cc9fd7994cb
(DIR) parent 0afe9dbd5fb5cf6f67e834bea55b61e0a15223c9
(HTM) Author: Lennart Melzer <me@lmaa.name>
Date: Tue, 13 Mar 2012 11:49:38 +0100
[fixes #12] make sure we use Thor style source_root for migration generator
Diffstat:
M generators/reportable_migration/re… | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/generators/reportable_migration/reportable_migration_generator.rb b/generators/reportable_migration/reportable_migration_generator.rb
@@ -2,11 +2,10 @@ class ReportableMigrationGenerator < Rails::Generators::Base
include Rails::Generators::Migration
+ source_root File.expand_path('../templates/', __FILE__)
+
def create_migration
- migration_template(
- File.join(File.dirname(__FILE__), 'templates', 'migration.rb'),
- 'db/migrate/create_reportable_cache.rb'
- )
+ migration_template('migration.rb', 'db/migrate/create_reportable_cache.rb')
end
def self.next_migration_number(dirname)