Created
May 7, 2019 00:03
-
-
Save localhostdotdev/659f4c5371d9a2649cda262141c9a88f to your computer and use it in GitHub Desktop.
Revisions
-
localhostdotdev created this gist
May 7, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@  ```ruby puts Contact.all.map { |c| "C#{c.id} [style=filled,color=greenyellow]" } + Book.all.map { |b| "B#{b.id} [style=filled,color=lightcyan]" } + BookContact.all.map { |bc| "C#{bc.contact_id} -> B#{bc.book_id}" } ``` ```graphiz digraph G { C1 [style=filled,color=greenyellow] C2 [style=filled,color=greenyellow] C3 [style=filled,color=greenyellow] C4 [style=filled,color=greenyellow] C5 [style=filled,color=greenyellow] C6 [style=filled,color=greenyellow] C7 [style=filled,color=greenyellow] C8 [style=filled,color=greenyellow] C9 [style=filled,color=greenyellow] C10 [style=filled,color=greenyellow] B1 [style=filled,color=lightcyan] B2 [style=filled,color=lightcyan] B3 [style=filled,color=lightcyan] B4 [style=filled,color=lightcyan] B5 [style=filled,color=lightcyan] B6 [style=filled,color=lightcyan] C1 -> B1 C2 -> B1 C1 -> B2 C2 -> B2 C3 -> B2 C4 -> B2 C4 -> B3 C5 -> B3 C6 -> B3 C3 -> B4 C4 -> B4 C5 -> B4 C6 -> B4 C1 -> B1 C10 -> B1 } ```