diff --git a/Pearlception/app/models/company.rb b/Pearlception/app/models/company.rb index 3a4fb41..fdc526f 100644 --- a/Pearlception/app/models/company.rb +++ b/Pearlception/app/models/company.rb @@ -1,4 +1,4 @@ class Company < ApplicationRecord - belongs_to :user + has_many :users has_many :runs end diff --git a/Pearlception/app/models/user.rb b/Pearlception/app/models/user.rb index 0a39c7f..a44f648 100644 --- a/Pearlception/app/models/user.rb +++ b/Pearlception/app/models/user.rb @@ -1,5 +1,5 @@ class User < ApplicationRecord - has_one :company + belongs_to :company has_many :runs # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable diff --git a/Pearlception/app/views/companies/index.html.erb b/Pearlception/app/views/companies/index.html.erb index 8a195dd..b505cdf 100644 --- a/Pearlception/app/views/companies/index.html.erb +++ b/Pearlception/app/views/companies/index.html.erb @@ -59,15 +59,14 @@
| # | Company ID | Company Name | Registration Serial Key | @@ -80,6 +79,27 @@ <% else %>
|---|---|---|---|
| + <%= company.id %> + | + + ++ <%= company.company_name %> + | + + ++ <%= company.company_token %> + | + <% end %> +