dbmapper 0.0.5 → 0.0.6
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/README.md +12 -4
- data/dbmapper-0.0.5.gem +0 -0
- data/lib/dbmapper.rb +1 -1
- data/lib/dbmapper/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b926be6c226f610c587f63322dd740106c3d98f7
|
4
|
+
data.tar.gz: 7676739815f55d861779afce6a7b68bfb1e6b7c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c14ffb1744731aec43de6c43e4eadfb17acb36beb3d56ef7ad559d2008939e8e24b547e604d219dc4fc18db8bd23bea402d0cd5358c539865042c122475889b
|
7
|
+
data.tar.gz: 91a9e2c96d409397627efa235e927455901d8920857ac41d44ccab9c0907c62ec2ab3f3aa9b5036b977df73c63763ffba5d1fa8f22e183e6d7ba101aff34ea2d
|
data/README.md
CHANGED
@@ -14,13 +14,14 @@ And then execute:
|
|
14
14
|
|
15
15
|
$ bundle
|
16
16
|
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install dbmapper
|
20
17
|
|
21
18
|
## Usage
|
22
19
|
|
23
20
|
Start by opening up the rails console with `rails c`
|
21
|
+
the very first thing that you want to do is load up the databse base
|
22
|
+
```
|
23
|
+
Rails.application.eager_load!
|
24
|
+
```
|
24
25
|
then create a new instance of the dbmapper with
|
25
26
|
```
|
26
27
|
db = Dbmapper::DatabaseMapper.new
|
@@ -32,7 +33,14 @@ To print out all your models run
|
|
32
33
|
```
|
33
34
|
db.all_models
|
34
35
|
```
|
35
|
-
|
36
|
+
To print out all your columns run
|
37
|
+
```
|
38
|
+
db.all_columns
|
39
|
+
```
|
40
|
+
To print out all your models with their associations run
|
41
|
+
```
|
42
|
+
db.all_models_with_association
|
43
|
+
```
|
36
44
|
|
37
45
|
## Contributing
|
38
46
|
|
data/dbmapper-0.0.5.gem
ADDED
Binary file
|
data/lib/dbmapper.rb
CHANGED
@@ -40,7 +40,7 @@ module Dbmapper
|
|
40
40
|
ActiveRecord::Base.descendants.each do |model|
|
41
41
|
text_file.write(model)
|
42
42
|
text_file.write("\n")
|
43
|
-
model.
|
43
|
+
model.reflect_on_all_associations.map(&:name).each do |assocations|
|
44
44
|
association_string = association_string + " #{assocations},"
|
45
45
|
end
|
46
46
|
text_file.write(association_string)
|
data/lib/dbmapper/version.rb
CHANGED
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sh6khan
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- dbmapper-0.0.2.gem
|
55
55
|
- dbmapper-0.0.3.gem
|
56
56
|
- dbmapper-0.0.4.gem
|
57
|
+
- dbmapper-0.0.5.gem
|
57
58
|
- dbmapper.gemspec
|
58
59
|
- lib/dbmapper.rb
|
59
60
|
- lib/dbmapper/version.rb
|