rails_prune 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_prune/task.rake +9 -2
- data/lib/rails_prune/version.rb +1 -1
- data/rails_prune.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4681790020ec4c71f6ebfe61283306e810cac6df
|
4
|
+
data.tar.gz: 7212e85068eb9c4106965358a70342dd295b6c13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce7aeffa17339c2ecea33fc21e70721c1c9ffe3489f870170f43250fcff4f725685bab63f6485260ca2279ff0c86d67538726aa735523adfa7a32c9a84903b02
|
7
|
+
data.tar.gz: a29ff9d8db343ca6fcb87e362516947fc2f8446551127f822864fbefac98540f3063699ff967b5beffe271326805b5b97b3f5e74fad5cc28f30821d4808ed8e2
|
data/lib/rails_prune/task.rake
CHANGED
@@ -11,8 +11,15 @@ namespace :db do
|
|
11
11
|
Rails.application.eager_load!
|
12
12
|
|
13
13
|
connection = ActiveRecord::Base.connection
|
14
|
-
quoted_table_names = (ActiveRecord::Base.descendants - [ActiveRecord::SchemaMigration])
|
14
|
+
quoted_table_names = (ActiveRecord::Base.descendants - [ActiveRecord::SchemaMigration])
|
15
|
+
.select(&:table_exists?)
|
16
|
+
.map(&:quoted_table_name)
|
15
17
|
|
16
|
-
|
18
|
+
sql = <<-SQL.strip_heredoc
|
19
|
+
TRUNCATE TABLE #{quoted_table_names.join(",")}
|
20
|
+
SQL
|
21
|
+
|
22
|
+
$stderr.puts sql
|
23
|
+
connection.execute(sql)
|
17
24
|
end
|
18
25
|
end
|
data/lib/rails_prune/version.rb
CHANGED
data/rails_prune.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "rails", "
|
21
|
+
spec.add_dependency "rails", ">= 4"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.12"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_prune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kim Burge Strand
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -93,3 +93,4 @@ signing_key:
|
|
93
93
|
specification_version: 4
|
94
94
|
summary: A rake task for Rails to truncate your database.
|
95
95
|
test_files: []
|
96
|
+
has_rdoc:
|