-
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.
Remove dynamic category list for requirements
Just use a static based on the document tags
- Loading branch information
Showing
29 changed files
with
87 additions
and
496 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 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
18 changes: 18 additions & 0 deletions
18
db/migrate/20250218155701_drop_local_authority_categories_table.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,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class DropLocalAuthorityCategoriesTable < ActiveRecord::Migration[7.2] | ||
def change | ||
safety_assured do | ||
drop_table :local_authority_categories do |t| | ||
t.references :local_authority, null: false, index: true, foreign_key: true | ||
t.string :description, null: false | ||
t.virtual :search, type: :tsvector, as: category_sql, stored: true | ||
|
||
t.timestamps | ||
|
||
t.index [:local_authority_id, :description], unique: true | ||
t.index [:local_authority_id, :search], using: :gin | ||
end | ||
end | ||
end | ||
end |
19 changes: 19 additions & 0 deletions
19
db/migrate/20250218160812_add_category_to_local_authority_requirement.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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddCategoryToLocalAuthorityRequirement < ActiveRecord::Migration[7.2] | ||
class LocalAuthorityRequirement < ActiveRecord::Base; end | ||
|
||
def change | ||
safety_assured do | ||
add_column :local_authority_requirements, :category, :string, limit: 30 | ||
|
||
up_only do | ||
LocalAuthorityRequirement.find_each do |requirement| | ||
requirement.update!(category: "other") | ||
end | ||
|
||
change_column_null :local_authority_requirements, :category, false | ||
end | ||
end | ||
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
99 changes: 0 additions & 99 deletions
99
engines/bops_admin/app/controllers/bops_admin/categories_controller.rb
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
9 changes: 0 additions & 9 deletions
9
engines/bops_admin/app/views/bops_admin/categories/_form.html.erb
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
engines/bops_admin/app/views/bops_admin/categories/_side_navigation.html.erb
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
engines/bops_admin/app/views/bops_admin/categories/edit.html.erb
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
engines/bops_admin/app/views/bops_admin/categories/index.html.erb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.