padrino-gen 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/padrino-gen/padrino-tasks/activerecord.rb +31 -4
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c449949c0295889166784c7a75e8229cfa8e7a11f80ab5193d71e71977b9fd16
|
4
|
+
data.tar.gz: 10fca63d349d79e817191fe41a1ab6471989b58a68fe12603f918eb2daf69aa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a380bfd0aac1774a49a4acc2253d43bc1f2369802a3acefa09ae62987831c858c03696c15f95d55e0245c8c53777ffc194437e25ad4af69bce15c35f22cea2fb
|
7
|
+
data.tar.gz: 458d7dba850cb8d798654f0ae39dbc4063e5fbca88604e605537c1bfdc12d65050869d637de65757376eb4c3816d3138b111d18a364eaef8b74af00ce7b6843d
|
@@ -124,7 +124,13 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
124
124
|
desc "Migrate the database through scripts in db/migrate and update db/schema.rb by invoking ar:schema:dump. Target specific version with MIGRATION_VERSION=x. Turn off output with VERBOSE=false."
|
125
125
|
task :migrate => :skeleton do
|
126
126
|
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
|
127
|
-
|
127
|
+
|
128
|
+
if less_than_active_record_5_2?
|
129
|
+
ActiveRecord::Migrator.migrate("db/migrate/", env_migration_version)
|
130
|
+
else
|
131
|
+
ActiveRecord::MigrationContext.new("db/migrate/").migrate(env_migration_version)
|
132
|
+
end
|
133
|
+
|
128
134
|
Rake::Task["ar:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
|
129
135
|
end
|
130
136
|
|
@@ -194,7 +200,12 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
194
200
|
desc "Raises an error if there are pending migrations."
|
195
201
|
task :abort_if_pending_migrations => :skeleton do
|
196
202
|
if defined? ActiveRecord
|
197
|
-
pending_migrations =
|
203
|
+
pending_migrations =
|
204
|
+
if less_than_active_record_5_2?
|
205
|
+
ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations
|
206
|
+
else
|
207
|
+
ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).open.pending_migrations
|
208
|
+
end
|
198
209
|
|
199
210
|
if pending_migrations.any?
|
200
211
|
puts "You have #{pending_migrations.size} pending migrations:"
|
@@ -357,13 +368,25 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
357
368
|
def migrate_as(type)
|
358
369
|
version = env_migration_version
|
359
370
|
fail "MIGRATION_VERSION is required" unless version
|
360
|
-
|
371
|
+
|
372
|
+
if less_than_active_record_5_2?
|
373
|
+
ActiveRecord::Migrator.run(type, "db/migrate/", version)
|
374
|
+
else
|
375
|
+
ActiveRecord::MigrationContext.new('db/migrate/').run(type, version)
|
376
|
+
end
|
377
|
+
|
361
378
|
dump_schema
|
362
379
|
end
|
363
380
|
|
364
381
|
def move_as(type)
|
365
382
|
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
366
|
-
|
383
|
+
|
384
|
+
if less_than_active_record_5_2?
|
385
|
+
ActiveRecord::Migrator.send(type, 'db/migrate/', step)
|
386
|
+
else
|
387
|
+
ActiveRecord::MigrationContext.new('db/migrate/').send(type, step)
|
388
|
+
end
|
389
|
+
|
367
390
|
dump_schema
|
368
391
|
end
|
369
392
|
|
@@ -375,6 +398,10 @@ if PadrinoTasks.load?(:activerecord, defined?(ActiveRecord))
|
|
375
398
|
"#{Padrino.root}/db/#{Padrino.env}_structure.sql"
|
376
399
|
end
|
377
400
|
|
401
|
+
def less_than_active_record_5_2?
|
402
|
+
ActiveRecord.version < Gem::Version.create("5.2.0")
|
403
|
+
end
|
404
|
+
|
378
405
|
task 'db:migrate' => 'ar:migrate'
|
379
406
|
task 'db:create' => 'ar:create'
|
380
407
|
task 'db:drop' => 'ar:drop'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Padrino Team
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-
|
14
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: padrino-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.14.
|
22
|
+
version: 0.14.4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.14.
|
29
|
+
version: 0.14.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bundler
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,28 +47,28 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.14.
|
50
|
+
version: 0.14.4
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 0.14.
|
57
|
+
version: 0.14.4
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: padrino-mailer
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.14.
|
64
|
+
version: 0.14.4
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.14.
|
71
|
+
version: 0.14.4
|
72
72
|
description: Generators for easily creating and building padrino applications from
|
73
73
|
the console
|
74
74
|
email: padrinorb@gmail.com
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: 1.3.6
|
218
218
|
requirements: []
|
219
219
|
rubyforge_project: padrino-gen
|
220
|
-
rubygems_version: 2.
|
220
|
+
rubygems_version: 2.7.8
|
221
221
|
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: Generators for easily creating and building padrino applications
|