migration_opener 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/migration_opener/version.rb +1 -1
- data/lib/migration_opener.rb +8 -6
- metadata +1 -1
data/lib/migration_opener.rb
CHANGED
@@ -11,13 +11,15 @@ module MigrationOpener
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
Rails::Generators::Migration
|
15
|
-
|
14
|
+
if defined?(Rails::Generators::Migration)
|
15
|
+
Rails::Generators::Migration.class_eval do
|
16
|
+
alias_method :origin_migration_template, :migration_template
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
def migration_template(source, destination=nil, config={})
|
19
|
+
file_created = origin_migration_template(source, destination, config)
|
20
|
+
if MigrationOpener.enabled?
|
21
|
+
system("#{MigrationOpener.editor_bin} #{file_created}")
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|