dbmapper 0.0.3 → 0.0.4

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: 28e9c48d3e2603c383086a6f09ff8118d4300813
4
- data.tar.gz: 45714ec999bec23d6d2a86b3fbf6212afdffc508
3
+ metadata.gz: 10eacb46433981b9d015f8a30c8e86d5fd54c2ee
4
+ data.tar.gz: 978101226c3ce0f6f44eb4b2bda9f18adebef075
5
5
  SHA512:
6
- metadata.gz: eea244d505af57d18a13bc6223a58eea3af0ccd40cd428fff9e876676e0f0a322185e6d365cda29e57cb241ce134addaf14028eebac3d9eaaf74c29d5d25f81f
7
- data.tar.gz: ca15f08bd143d9f6cc08247233b4a9620d2a591b62b93d4a3c314d302c37e3e11e9f204e11e7e2ac6f54238f3de42d38c97ddf90197244fb49f66d27e391933d
6
+ metadata.gz: 641c03d7c20bf192edafa02787330964d375df997392fa33f3ab5ece5024625ad8e14dcc7127972718af3950b3c6598aac46eed5c913a3184832b9b053565688
7
+ data.tar.gz: 0e8f41d7488d73e098e1092f79bcbd8fc96d89ba05a6d0ce008a28df7cbd61ae79074090db2d0e5017fd13c859f3d4812b53d7ba8a7951fdd2070a20ee585153
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module Dbmapper
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/dbmapper.rb CHANGED
@@ -2,7 +2,7 @@ require "dbmapper/version"
2
2
 
3
3
  module Dbmapper
4
4
  class DatabaseMapper
5
-
5
+
6
6
  def initlialize
7
7
  Rails.application.eager_load!
8
8
  end
@@ -11,7 +11,8 @@ module Dbmapper
11
11
  #open file
12
12
  text_file = File.open("mapped_databse.txt", 'w')
13
13
  ActiveRecord::Base.descendants.each do |model|
14
- text_file.write(model + '\n')
14
+ text_file.write(model)
15
+ text_file.write('\n')
15
16
  end
16
17
  puts "All your models have been written to mapped_databse.txt"
17
18
  text_file.close
@@ -21,9 +22,11 @@ module Dbmapper
21
22
  #open file
22
23
  text_file = File.open("mapped_databse.txt", 'w')
23
24
  ActiveRecord::Base.descendants.each do |model|
24
- text_file.write(model + '\n');
25
+ text_file.write(model)
26
+ text_file.write('\n\n')
25
27
  model.column_names.each do |column|
26
28
  text_file.write(column)
29
+ text_file.write('\n')
27
30
  end
28
31
  end
29
32
  puts "All your columns have been written to mapped_databse.txt"
@@ -35,11 +38,13 @@ module Dbmapper
35
38
  text_file = File.open("mapped_databse.txt", 'w')
36
39
  association_string = "-->"
37
40
  ActiveRecord::Base.descendants.each do |model|
38
- text_file.write(model + '\n')
41
+ text_file.write(model)
42
+ text_file.write('\n')
39
43
  model.relfect_on_all_associations.map(&:name).each do |assocations|
40
44
  association_string = association_string + " #{assocations},"
41
45
  end
42
- text_file.write(association_string + '\n')
46
+ text_file.write(association_string)
47
+ text_file.write('\n\n')
43
48
  association_string = "-->"
44
49
  end
45
50
  puts "all models with their assocations have been written to mapped_databse.txt"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sh6khan
@@ -51,6 +51,8 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - dbmapper-0.0.1.gem
54
+ - dbmapper-0.0.2.gem
55
+ - dbmapper-0.0.3.gem
54
56
  - dbmapper.gemspec
55
57
  - lib/dbmapper.rb
56
58
  - lib/dbmapper/version.rb