From 5bf274d4c50f8c4a8f89059989f94f138e0d03c2 Mon Sep 17 00:00:00 2001 From: Sergio Souza Date: Tue, 10 Oct 2023 15:23:14 -0300 Subject: [PATCH 1/2] Update Readme --- README.md | 6 +++--- app/models/project.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b1a30e867..cc836ed93 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ The principles that we believe in are: Installation ------------ +**WARNING**: It is **NOT** recommended to create the database using the db:migrate command during the installation process. Some migrations in the project have become outdated due to Rails updates during the application's development. Therefore, if you create the database from scratch using these outdated migrations instead of loading the current schema, the application will not function as intended, and some tests will fail. Be aware! + First up, your system will need the [prerequisites for running Ruby on Rails installed](https://guides.rubyonrails.org/getting_started.html) Once you have these: @@ -135,9 +137,7 @@ Or using docker: # Prepare container $ docker compose build $ docker compose run --rm web yarn install - $ docker compose run --rm web bundle exec rake db:create - $ docker compose run --rm web bundle exec rake db:migrate - $ docker compose run --rm web bundle exec rake db:seed + $ docker compose run --rm web bundle exec rake db:setup # Up container $ docker compose up diff --git a/app/models/project.rb b/app/models/project.rb index 949fd0234..5ba1a191d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -28,7 +28,7 @@ class Project < ApplicationRecord has_many :integrations, dependent: :destroy has_many :changesets, dependent: :destroy has_many :integrations, dependent: :destroy - has_many :ownerships + has_many :ownerships, dependent: :destroy has_many :teams, through: :ownerships has_many :memberships, dependent: :destroy has_many :users, -> { distinct }, through: :memberships From 7606e2644568104d8d34fe47888835abf3c2d886 Mon Sep 17 00:00:00 2001 From: Sergio Souza Date: Tue, 10 Oct 2023 15:43:30 -0300 Subject: [PATCH 2/2] Create test for project model --- spec/models/project_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 569087820..8fedf5c82 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -289,6 +289,7 @@ subject { build :project } it { is_expected.to belong_to(:tag_group) } it { is_expected.to have_many(:changesets) } + it { is_expected.to have_many(:ownerships).dependent(:destroy) } end describe '#as_json' do