migration_opener 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module MigrationOpener
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -11,13 +11,15 @@ module MigrationOpener
11
11
  end
12
12
  end
13
13
 
14
- Rails::Generators::Migration.class_eval do
15
- alias_method :origin_migration_template, :migration_template
14
+ if defined?(Rails::Generators::Migration)
15
+ Rails::Generators::Migration.class_eval do
16
+ alias_method :origin_migration_template, :migration_template
16
17
 
17
- def migration_template(source, destination=nil, config={})
18
- file_created = origin_migration_template(source, destination, config)
19
- if MigrationOpener.enabled?
20
- system("#{MigrationOpener.editor_bin} #{file_created}")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_opener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: