Package not found. Please check the package name and try again.

modular_migration 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dad44a44d746cf519ad87588ea91161ceaa60f2d
4
- data.tar.gz: e32665277e66ad53fcbd03989bf5ff6dab78ba81
3
+ metadata.gz: d6dbd152558bf5cb35d9e355e41b5bfdde0c0892
4
+ data.tar.gz: 834e4e4517ff2fb748dbca32f393b3a6b68dbfce
5
5
  SHA512:
6
- metadata.gz: 3a80163ed27e68b871505d9a92748befaeedd9529278397ddd3b9208f79182f3c82014f412a35b83dbd1331b3adbf9d9b41a4b66a68ccc37e568d700bcc14005
7
- data.tar.gz: 009eb782e11eb6a4707ab025683812c4bae16101ce9ebfe5a4a5f2f90d0c746c48dbfbf097e5893884aad5ac2de71857c6a2a44172d71645fb629354e7468d87
6
+ metadata.gz: 42049d9862d53b5c8f5d986f97dd6fd94e6e377df214e2461e9e1e2a13b0000877b70cd928c043ed4bce52cb499b547f7098ad88afa3195d5ab4a3ec9a750b8f
7
+ data.tar.gz: 283d84e139de7e215c24b150a90d2bd6ba96417980817203ae2dec18e05782da40caf64316dbaf251b3b03799db13f70cb5f624a0379823447b5a690387b3f48
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  *.rbc
2
3
  *.sassc
3
4
  .sass-cache
@@ -13,6 +14,7 @@ capybara-*.html
13
14
  /coverage/
14
15
  /spec/tmp/*
15
16
  **.orig
17
+ Gemfile.lock
16
18
  rerun.txt
17
19
  pickle-email-*.html
18
20
  .project
data/README.md CHANGED
@@ -44,7 +44,8 @@ Do nothing.
44
44
 
45
45
  ## Credits
46
46
 
47
- - [LiJia.Tong](https://github.com/user-tony/) @[Ihaveu](https://www.ihaveu.com/home)
47
+ - [LiJia.Tong](https://github.com/user-tony/) @[ihaveu](https://www.ihaveu.com/home)
48
+ - [swordray](https://github.com/swordray) @[ihaveu](http://www.ihaveu.com/home) @[shuhai](http://tw.shuhai.org/) @[leaf](http://leaf.iacger.com)
48
49
 
49
50
  ## License
50
51
 
@@ -4,7 +4,7 @@ module ActiveRecord
4
4
 
5
5
  def create_migration_file
6
6
  set_local_assigns!
7
- validate_file_name!
7
+ validate_file_name! if self.respond_to?(:validate_file_name)
8
8
  if migration_action.match(/(add|remove)/)
9
9
  table = table_name.singularize
10
10
  modular = table.gsub(/_/, '/').camelize.safe_constantize
@@ -21,12 +21,12 @@ module ActiveRecord
21
21
  migration = modular ? modular.to_s.underscore : []
22
22
  end
23
23
  migration = join_tables.map(&:singularize).join('_') if migration_action.match(/join/)
24
- migration = FileUtils.mkdir_p("db/migrate/#{migration}") if migration
24
+ migration = FileUtils.mkdir_p(File.join("db", "migrate", migration)) if migration
25
25
  migration_file = File.join(migration.join('/'), "#{file_name}.rb")
26
- migration_template @migration_template, migration_file
27
- end
26
+ template_file = Rails.version.to_i < 4 ? 'migration.rb' : '../../migration/templates/create_table_migration.rb'
27
+ migration_template template_file, migration_file
28
+ end
28
29
 
29
30
  end
30
31
  end
31
32
  end
32
-
@@ -1,3 +1,3 @@
1
1
  module ModularMigration
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modular_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lijia Tong