rails-erd-d3 0.6.1 → 0.6.2
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/Gemfile +4 -0
- data/README.md +4 -36
- data/lib/templates/js.html +17 -3
- data/lib/templates/modals.html.erb +12 -7
- data/rails-erd-d3.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 669b8c53622c85d66ddb72a399c07881579ab263
|
4
|
+
data.tar.gz: 3c7f273abfa58b44a5783d17087591ae44d516cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6dec3aadd4aa15d3162b4b618e8090a2dd91d03650ecc034603d28596ff87d773752bfc26d8fc9b6692ac1fb3920f0d057fb031506fdc10f83c01e238cbf5dc
|
7
|
+
data.tar.gz: c18d321a279720c7b43e96e663f398de62e97ce6b6515267b55c2299a128cde6316832f4f0a7c0b310bbb9d6ffe6bfb1509be36cf7ac81868e1d22842fa632b2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -62,33 +62,6 @@ function zoomed() {
|
|
62
62
|
+ ")"
|
63
63
|
);
|
64
64
|
```
|
65
|
-
- Add arrows
|
66
|
-
```
|
67
|
-
svg.append("defs").append("marker")
|
68
|
-
.attr("id", "arrow")
|
69
|
-
.attr("viewBox", "0 -5 10 10")
|
70
|
-
.attr("refX", 32)
|
71
|
-
.attr("refY", 0)
|
72
|
-
.attr("markerWidth", 7)
|
73
|
-
.attr("markerHeight", 7)
|
74
|
-
.attr("orient", "auto")
|
75
|
-
.append("svg:path")
|
76
|
-
.attr("d", "M0,-5L10,0L0,5");
|
77
|
-
|
78
|
-
var link = svg.append('g')
|
79
|
-
.attr("marker-end", "url(#arrow)");
|
80
|
-
```
|
81
|
-
- Add
|
82
|
-
```
|
83
|
-
var link = svg.append('g')
|
84
|
-
.attr('stroke-width', 2)
|
85
|
-
```
|
86
|
-
- Add
|
87
|
-
```
|
88
|
-
node.append('circle')
|
89
|
-
.attr('stroke', 'white')
|
90
|
-
.attr('stroke-width', 3)
|
91
|
-
```
|
92
65
|
- Freeze
|
93
66
|
- On
|
94
67
|
```
|
@@ -104,15 +77,10 @@ node.append('circle')
|
|
104
77
|
- Add link to another model in model window
|
105
78
|
- Add tests
|
106
79
|
- ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
|
107
|
-
- Sort
|
108
|
-
-
|
109
|
-
|
110
|
-
|
111
|
-
- [x] has_many
|
112
|
-
- has_many :through
|
113
|
-
- has_one :through
|
114
|
-
- has_and_belongs_to_many
|
115
|
-
- Polymorphic associations
|
80
|
+
- Sort by:
|
81
|
+
- number of connections
|
82
|
+
- number of entries in the table
|
83
|
+
- Show table structure on the diagram
|
116
84
|
- Safe as jpg, png
|
117
85
|
- Dependent destroy
|
118
86
|
|
data/lib/templates/js.html
CHANGED
@@ -2,11 +2,25 @@
|
|
2
2
|
$(".visible").click(function() {
|
3
3
|
var klass = $(this).attr("id");
|
4
4
|
|
5
|
-
if ($(this).prop("checked")){
|
6
|
-
$(
|
5
|
+
if ($(this).prop("checked")) {
|
6
|
+
$(document.getElementsByClassName(klass)).show();
|
7
7
|
}
|
8
8
|
else {
|
9
|
-
$(
|
9
|
+
$(document.getElementsByClassName(klass)).hide();
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
$("#check-all").click(function() {
|
14
|
+
if($(this).prop("checked")) {
|
15
|
+
$(".visible").each(function() {
|
16
|
+
$(this).prop("checked", false);
|
17
|
+
$(this).click();
|
18
|
+
});
|
19
|
+
} else {
|
20
|
+
$(".visible").each(function() {
|
21
|
+
$(this).prop("checked", true);
|
22
|
+
$(this).click();
|
23
|
+
});
|
10
24
|
}
|
11
25
|
});
|
12
26
|
|
@@ -17,19 +17,20 @@
|
|
17
17
|
<th>#</th>
|
18
18
|
<th>name</th>
|
19
19
|
<th>type</th>
|
20
|
-
<th>
|
20
|
+
<th>associated class</th>
|
21
21
|
</tr>
|
22
22
|
</thead>
|
23
23
|
<tbody>
|
24
|
-
<% model.reflections.each_with_index do |
|
25
|
-
<% name = r[0] %>
|
24
|
+
<% model.reflections.each_with_index do |(name, data), index| %>
|
26
25
|
<tr>
|
27
26
|
<th><%= index + 1 %></th>
|
28
|
-
<td><%= name
|
29
|
-
<td><%= model.reflections[name].macro %></td>
|
27
|
+
<td><%= name %></td>
|
30
28
|
<td>
|
31
|
-
<%=
|
32
|
-
<%= "
|
29
|
+
<%= data.macro %>
|
30
|
+
<%= "<br>through: #{data.options[:through]}" if data.options[:through] %>
|
31
|
+
</td>
|
32
|
+
<td>
|
33
|
+
<%= data.options[:class_name] || name.camelize.singularize %>
|
33
34
|
</td>
|
34
35
|
</tr>
|
35
36
|
<% end %>
|
@@ -86,6 +87,10 @@
|
|
86
87
|
<th>#</th>
|
87
88
|
<th>name</th>
|
88
89
|
<th>show</th>
|
90
|
+
<th>
|
91
|
+
check all
|
92
|
+
<input id="check-all" type="checkbox" value="" checked>
|
93
|
+
</th>
|
89
94
|
</tr>
|
90
95
|
</thead>
|
91
96
|
<tbody>
|
data/rails-erd-d3.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "rails-erd-d3"
|
7
7
|
spec.authors = ["Roman Krasavtsev"]
|
8
8
|
spec.email = ["mr.krasavtsev@gmail.com"]
|
9
|
-
spec.version = "0.6.
|
9
|
+
spec.version = "0.6.2"
|
10
10
|
spec.summary = "Entity–relationship diagram with D3.js for Rails application"
|
11
11
|
spec.description = "This gem creates entity–relationship diagram with D3.js for your Rails application"
|
12
12
|
spec.homepage = "https://github.com/RomanKrasavtsev/rails-erd-d3"
|