ridgepoler-rails 1.0.0 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/lib/generators/rails/ridgepole/ridgepole_generator.rb +13 -0
- data/lib/generators/rails/ridgepole/templates/schema.rb +1 -1
- data/lib/ridgepoler/rails/tasks/override.rake +2 -2
- data/lib/ridgepoler/rails/tasks/ridgepole.rake +8 -1
- data/lib/ridgepoler/rails/version.rb +1 -1
- metadata +6 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7136c32334302e2751002581b1d5bc8a11f6c864d990c1e8eaa0c339a6c20f33
|
4
|
+
data.tar.gz: 1705db54f143a01fed319308eb4caf0baade7416307134198e87560d7ea990c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22fd9791977bb3af644df0bd53e5bdcc65f4833f48878e051b9c83b932b8fe4c46f393f82e601542918e1f68e35e2469055564e96defae19bdda16d3c1a79cc5
|
7
|
+
data.tar.gz: 5286f23129601c9859c67c33e9c896f103800531a857d6ba62a6d6740256c0bbbc30f50f9d15b120e0f30529340e8edb2701e6cd21546f228cbc1d693f470a12
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Once installed, Ridgepoler will generate migration files instead of ActiveRecord
|
|
23
23
|
|
24
24
|
## Rake tasks
|
25
25
|
|
26
|
-
Ridgepoler will replace or clear some db tasks. If you doesn't need that overrides, you can set `config.
|
26
|
+
Ridgepoler will replace or clear some db tasks. If you doesn't need that overrides, you can set `config.ridgepole.override_db_tasks = false`.
|
27
27
|
|
28
28
|
### Clear tasks
|
29
29
|
|
data/Rakefile
CHANGED
@@ -5,6 +5,8 @@ require 'rails/generators/active_record/model/model_generator'
|
|
5
5
|
module Rails
|
6
6
|
module Generators
|
7
7
|
class RidgepoleGenerator < ActiveRecord::Generators::ModelGenerator
|
8
|
+
IGNORE_ATTRIBUTE_OPTIONS = %i[foreign_key]
|
9
|
+
|
8
10
|
def self.source_paths
|
9
11
|
[ActiveRecord::Generators::ModelGenerator.source_root, File.expand_path('../templates', __FILE__)]
|
10
12
|
end
|
@@ -15,6 +17,17 @@ module Rails
|
|
15
17
|
|
16
18
|
template 'schema.rb', File.join('db/schema', class_path, "#{file_name}.rb")
|
17
19
|
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def options_for_attribute(attribute)
|
24
|
+
opts = attribute.options_for_migration.
|
25
|
+
except(*IGNORE_ATTRIBUTE_OPTIONS).
|
26
|
+
map { |k, v| "#{k}: #{v.inspect}" }.
|
27
|
+
join(', ')
|
28
|
+
|
29
|
+
opts.present? ? ", #{opts}" : ""
|
30
|
+
end
|
18
31
|
end
|
19
32
|
end
|
20
33
|
end
|
@@ -7,7 +7,7 @@ create_table :<%= table_name %><%= primary_key_type %>, force: :cascade do |t|
|
|
7
7
|
<% elsif attribute.token? -%>
|
8
8
|
t.string :<%= attribute.name %><%= attribute.inject_options %>
|
9
9
|
<% else -%>
|
10
|
-
t.<%= attribute.type %> :<%= attribute.name %><%= attribute
|
10
|
+
t.<%= attribute.type %> :<%= attribute.name %><%= options_for_attribute(attribute) %>
|
11
11
|
<% end -%>
|
12
12
|
<% end -%>
|
13
13
|
<% if options[:timestamps] %>
|
@@ -18,7 +18,14 @@ namespace :ridgepole do
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def ridgepole(env: Rails.env, dry_run: false)
|
21
|
-
args = ['ridgepole', '-a'
|
21
|
+
args = ['ridgepole', '-a']
|
22
|
+
|
23
|
+
args += if ENV['DATABASE_URL'].to_s.empty?
|
24
|
+
['-c', 'config/database.yml', '-E', env]
|
25
|
+
else
|
26
|
+
['-c', ENV['DATABASE_URL']]
|
27
|
+
end
|
28
|
+
|
22
29
|
args.push('--dry-run') if dry_run
|
23
30
|
args.push('--debug') if config.debug
|
24
31
|
args.push('--verbose') if config.verbose
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepoler-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Kusano
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 5.0.0
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.3'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 5.0.0
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5.3'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: ridgepole
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,7 +82,7 @@ homepage: https://github.com/space-pirates-llc/ridgepoler-rails
|
|
88
82
|
licenses:
|
89
83
|
- MIT
|
90
84
|
metadata: {}
|
91
|
-
post_install_message:
|
85
|
+
post_install_message:
|
92
86
|
rdoc_options: []
|
93
87
|
require_paths:
|
94
88
|
- lib
|
@@ -103,9 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
97
|
- !ruby/object:Gem::Version
|
104
98
|
version: '0'
|
105
99
|
requirements: []
|
106
|
-
|
107
|
-
|
108
|
-
signing_key:
|
100
|
+
rubygems_version: 3.2.3
|
101
|
+
signing_key:
|
109
102
|
specification_version: 4
|
110
103
|
summary: Provides integration between ridgepole and rails 5 newer
|
111
104
|
test_files: []
|