-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plug Batch info on Kitt callback and move back City on User to simpli…
…fy validation logic. (#325) * Plug Batch info on Kitt callback and move back City on User to simplify validation logic. * Rubocop * fix(users): revert some changes * fix(users): undo everything from #289 * fix(users): use kitt city name instead of slug * fix(users) last comments * fix(users): remove empty city froms seed * Wording + spacing * Remove Testville --------- Co-authored-by: Louis Ramos <louisramosdev@gmail.com> Co-authored-by: pil0u <8350914+pil0u@users.noreply.github.com>
- Loading branch information
1 parent
e85acfe
commit b1d6732
Showing
18 changed files
with
162 additions
and
144 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file was deleted.
Oops, something went wrong.
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddBackCityOnUsers < ActiveRecord::Migration[7.1] | ||
disable_ddl_transaction! | ||
|
||
def change | ||
add_reference :users, :city, index: { algorithm: :concurrently } | ||
add_foreign_key :users, :cities, validate: false | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
db/migrate/20231116030521_add_foreign_key_for_users_city_relationship.rb
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddForeignKeyForUsersCityRelationship < ActiveRecord::Migration[7.1] | ||
def change | ||
validate_foreign_key :users, :cities | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20231116174333_remove_city_and_size_from_batches.rb
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
class RemoveCityAndSizeFromBatches < ActiveRecord::Migration[7.1] | ||
def change | ||
safety_assured { remove_column :batches, :city_id, :bigint } | ||
safety_assured { remove_column :batches, :size, :int } | ||
end | ||
end |
This file contains 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 characters
Oops, something went wrong.