dbmapper 0.0.2 → 0.0.3
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 +4 -4
- data/dbmapper.gemspec +1 -1
- data/lib/dbmapper/version.rb +1 -1
- data/lib/dbmapper.rb +9 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28e9c48d3e2603c383086a6f09ff8118d4300813
|
4
|
+
data.tar.gz: 45714ec999bec23d6d2a86b3fbf6212afdffc508
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea244d505af57d18a13bc6223a58eea3af0ccd40cd428fff9e876676e0f0a322185e6d365cda29e57cb241ce134addaf14028eebac3d9eaaf74c29d5d25f81f
|
7
|
+
data.tar.gz: ca15f08bd143d9f6cc08247233b4a9620d2a591b62b93d4a3c314d302c37e3e11e9f204e11e7e2ac6f54238f3de42d38c97ddf90197244fb49f66d27e391933d
|
data/dbmapper.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["sh6khan"]
|
10
10
|
spec.email = ["sadman.khan999@gmail.com"]
|
11
11
|
spec.summary = %q{Maps out all the models in your database into a file}
|
12
|
-
spec.description = %q{
|
12
|
+
spec.description = %q{Mapp out all the models in your database into a file}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/dbmapper/version.rb
CHANGED
data/lib/dbmapper.rb
CHANGED
@@ -2,10 +2,7 @@ require "dbmapper/version"
|
|
2
2
|
|
3
3
|
module Dbmapper
|
4
4
|
class DatabaseMapper
|
5
|
-
|
6
|
-
def self.hello_world
|
7
|
-
puts "Hello World"
|
8
|
-
end
|
5
|
+
|
9
6
|
def initlialize
|
10
7
|
Rails.application.eager_load!
|
11
8
|
end
|
@@ -14,8 +11,9 @@ module Dbmapper
|
|
14
11
|
#open file
|
15
12
|
text_file = File.open("mapped_databse.txt", 'w')
|
16
13
|
ActiveRecord::Base.descendants.each do |model|
|
17
|
-
text_file.write(model)
|
14
|
+
text_file.write(model + '\n')
|
18
15
|
end
|
16
|
+
puts "All your models have been written to mapped_databse.txt"
|
19
17
|
text_file.close
|
20
18
|
end
|
21
19
|
|
@@ -23,11 +21,13 @@ module Dbmapper
|
|
23
21
|
#open file
|
24
22
|
text_file = File.open("mapped_databse.txt", 'w')
|
25
23
|
ActiveRecord::Base.descendants.each do |model|
|
26
|
-
text_file.write(model);
|
24
|
+
text_file.write(model + '\n');
|
27
25
|
model.column_names.each do |column|
|
28
26
|
text_file.write(column)
|
29
27
|
end
|
30
28
|
end
|
29
|
+
puts "All your columns have been written to mapped_databse.txt"
|
30
|
+
text_file.close
|
31
31
|
end
|
32
32
|
|
33
33
|
def all_models_with_association
|
@@ -35,13 +35,14 @@ module Dbmapper
|
|
35
35
|
text_file = File.open("mapped_databse.txt", 'w')
|
36
36
|
association_string = "-->"
|
37
37
|
ActiveRecord::Base.descendants.each do |model|
|
38
|
-
text_file.write(model)
|
38
|
+
text_file.write(model + '\n')
|
39
39
|
model.relfect_on_all_associations.map(&:name).each do |assocations|
|
40
40
|
association_string = association_string + " #{assocations},"
|
41
41
|
end
|
42
|
-
text_file.write(association_string)
|
42
|
+
text_file.write(association_string + '\n')
|
43
43
|
association_string = "-->"
|
44
44
|
end
|
45
|
+
puts "all models with their assocations have been written to mapped_databse.txt"
|
45
46
|
text_file.close
|
46
47
|
end
|
47
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbmapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sh6khan
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
41
|
+
description: Mapp out all the models in your database into a file
|
42
42
|
email:
|
43
43
|
- sadman.khan999@gmail.com
|
44
44
|
executables: []
|