activerecord-migrations 1.2.1 → 1.3.0

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: aedf5f1fecf8cf4ab31c1b94e28f549f373a2ec8
4
- data.tar.gz: 2f39bf268e9cd6c24dea0f3ca96d01eb539d33fc
3
+ metadata.gz: d638b63c5c8e22e7da7c043b28fd11572f649d2d
4
+ data.tar.gz: 276ac84d4cd5c477419620ff1580d29d4e7b5275
5
5
  SHA512:
6
- metadata.gz: 77796efe511842b401d4c702ee1cf92adc3bb45f0b461a67093fc6ffe51871c27735d7c15071f8d396c1fb8a2ec4acfebd5ef9ef061e6a87f6ec243d2e4e42da
7
- data.tar.gz: e352d462055868a684125e7bccd3b175f1b7c5a0852254e8cc7785af265e1c46b7a5d48972e806f3f2723338ea473061147a270191f02526a3bd5855e1368688
6
+ metadata.gz: a62506e9d2e75a553eb5f6d6b8af023613aba6595d4d5ba416e33eb6b12a9af32c99d4f893fc1b1bf290ea4d544caaa85fce8e06f309d115464570e55228d2e9
7
+ data.tar.gz: d10972e07782d7ebea25dc1bebc164f8b5f5ec06ec0be84b8f8008712ce261dd4f77429cdeb64319ff4a9c3b4cb19f66be6d8668fb3a29b8d839d16b583a0f37
@@ -0,0 +1,41 @@
1
+ # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ # THE SOFTWARE.
20
+
21
+ require 'rails/generators'
22
+ require 'rails/generators/active_record/migration/migration_generator'
23
+ require 'active_record/tasks/database_tasks'
24
+
25
+ module ActiveRecord
26
+ module Migrations
27
+ class Generator < ::ActiveRecord::Generators::MigrationGenerator
28
+ source_root ::ActiveRecord::Generators::MigrationGenerator.source_root
29
+
30
+ def create_migration_file
31
+ set_local_assigns!
32
+ validate_file_name!
33
+ migration_template @migration_template, File.join(db_migrate_path, "#{file_name}.rb")
34
+ end
35
+
36
+ def db_migrate_path
37
+ ::ActiveRecord::Migrations.migrations_root
38
+ end
39
+ end
40
+ end
41
+ end
@@ -59,7 +59,7 @@ namespace :db do
59
59
  abort "Could not locate schema file: #{paths.inspect}!"
60
60
  end
61
61
 
62
- puts "Schema path: #{@schema_path}"
62
+ puts "Found schema: #{@schema_path}"
63
63
  end
64
64
 
65
65
  desc 'Setup a new database if required and run migrations.'
@@ -32,11 +32,11 @@ namespace :db do
32
32
  options = []
33
33
  end
34
34
 
35
- require_relative 'generators'
35
+ require_relative '../../generator'
36
36
 
37
37
  parameters = [name] + options
38
-
39
- files = Rails::Generators.invoke "active_record:migration", parameters, :destination_root => ActiveRecord::Migrations.root
38
+
39
+ Rails::Generators.invoke "active_record:migrations:generator", parameters, :destination_root => ActiveRecord::Migrations.root
40
40
  end
41
41
  end
42
42
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module ActiveRecord
22
22
  module Migrations
23
- VERSION = "1.2.1"
23
+ VERSION = "1.3.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -110,10 +110,10 @@ files:
110
110
  - Rakefile
111
111
  - activerecord-migrations.gemspec
112
112
  - lib/active_record/migrations.rb
113
+ - lib/active_record/migrations/generator.rb
113
114
  - lib/active_record/migrations/tasks.rb
114
115
  - lib/active_record/migrations/tasks/db.rb
115
116
  - lib/active_record/migrations/tasks/db/fixtures.rb
116
- - lib/active_record/migrations/tasks/db/generators.rb
117
117
  - lib/active_record/migrations/tasks/db/migrations.rb
118
118
  - lib/active_record/migrations/tasks/db/seed.rb
119
119
  - lib/active_record/migrations/version.rb
@@ -1,13 +0,0 @@
1
-
2
- require 'rails/generators'
3
-
4
- if ActiveRecord::version >= Gem::Version.new("5.0.2")
5
- # This is a monkey patch to work around the flakey design of ActiveRecord migrations.
6
- require 'rails/generators/active_record/migration/migration_generator'
7
-
8
- class ::ActiveRecord::Generators::MigrationGenerator
9
- def db_migrate_path
10
- ActiveRecord::Migrations.migrations_root
11
- end
12
- end
13
- end