Initialized rails-erd gem to generate an ERD schema based on rails models
This commit is contained in:
parent
99747e3f2d
commit
b60c2d95a2
4 changed files with 14 additions and 2 deletions
2
Gemfile
2
Gemfile
|
|
@ -34,6 +34,8 @@ group :development do
|
|||
gem 'listen', '~> 3.3'
|
||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
||||
gem 'spring'
|
||||
# Generate erd (UML) schema from rails models
|
||||
gem 'rails-erd'
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
|
|
|
|||
10
Gemfile.lock
10
Gemfile.lock
|
|
@ -66,6 +66,7 @@ GEM
|
|||
msgpack (~> 1.0)
|
||||
builder (3.2.4)
|
||||
byebug (11.1.3)
|
||||
choice (0.2.0)
|
||||
concurrent-ruby (1.1.8)
|
||||
crass (1.0.6)
|
||||
erubi (1.10.0)
|
||||
|
|
@ -119,6 +120,11 @@ GEM
|
|||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
nokogiri (>= 1.6)
|
||||
rails-erd (1.6.1)
|
||||
activerecord (>= 4.2)
|
||||
activesupport (>= 4.2)
|
||||
choice (~> 0.2.0)
|
||||
ruby-graphviz (~> 1.2)
|
||||
rails-html-sanitizer (1.3.0)
|
||||
loofah (~> 2.3)
|
||||
railties (6.1.3.1)
|
||||
|
|
@ -131,6 +137,9 @@ GEM
|
|||
rb-fsevent (0.10.4)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.5)
|
||||
ruby-graphviz (1.2.5)
|
||||
rexml
|
||||
spring (2.1.1)
|
||||
sprockets (4.0.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
|
|
@ -163,6 +172,7 @@ DEPENDENCIES
|
|||
listen (~> 3.3)
|
||||
puma (~> 5.0)
|
||||
rails (~> 6.1.3, >= 6.1.3.1)
|
||||
rails-erd
|
||||
spring
|
||||
sqlite3 (~> 1.4)
|
||||
table_print (~> 1.5)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
class Activity < ApplicationRecord
|
||||
belongs_to :author, class_name: "User"
|
||||
|
||||
has_one :joined_user_activities
|
||||
has_one :user, :through => :joined_user_activities
|
||||
has_one :joined_user_activity
|
||||
has_one :user, :through => :joined_user_activity
|
||||
|
||||
validates :name, presence: true
|
||||
validates :author, presence: true
|
||||
|
|
|
|||
BIN
erd.pdf
Normal file
BIN
erd.pdf
Normal file
Binary file not shown.
Loading…
Reference in a new issue