Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

342607 - Remove ServerState model + transform it in a Server attribute #354

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Rails/Delegate:
- 'app/models/port_type.rb'
- 'app/models/room.rb'
- 'app/models/server.rb'
- 'app/models/server_state.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Expand Down Expand Up @@ -159,7 +158,6 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/port.rb'
- 'app/models/port_type.rb'
- 'app/models/server.rb'
- 'app/models/server_state.rb'
- 'app/models/type_composant.rb'

# Offense count: 5
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/power_distribution_units_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ def pdu_params
def search_params
params.permit(:sort, :sort_by, :page, :per_page, :q,
network_types: [], bay_ids: [], islet_ids: [], room_ids: [], frame_ids: [], cluster_ids: [],
gestion_ids: [], domaine_ids: [], modele_ids: [], server_state_ids: [], stack_ids: [])
gestion_ids: [], domaine_ids: [], modele_ids: [], stack_ids: [])
end
end
75 changes: 0 additions & 75 deletions app/controllers/server_states_controller.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/controllers/servers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def set_server
def server_params
params.expect(
server: [
:photo, :stack_id, :server_state_id, :comment, :cluster_id, :position, :frame_id, :gestion_id, :fc_futur,
:photo, :stack_id, :comment, :cluster_id, :position, :frame_id, :gestion_id, :fc_futur,
:rj45_cm, :name, :modele_id, :numero, :critique, :domaine_id, :fc_total, :fc_utilise, :rj45_total,
:rj45_utilise, :rj45_futur, :ipmi_utilise, :ipmi_futur, :ipmi_dedie,
:frame, # TODO: Check if it should be removed or if it's used somewhere
Expand All @@ -148,7 +148,7 @@ def server_params
def search_params
params.permit(:sort, :sort_by, :page, :per_page, :q,
network_types: [], bay_ids: [], islet_ids: [], room_ids: [], frame_ids: [], cluster_ids: [],
gestion_ids: [], domaine_ids: [], modele_ids: [], server_state_ids: [], stack_ids: [], category_ids: [])
gestion_ids: [], domaine_ids: [], modele_ids: [], stack_ids: [], category_ids: [])
end

def track_frame_and_position(old_values, new_values)
Expand Down
26 changes: 0 additions & 26 deletions app/views/server_states/_form.html.erb

This file was deleted.

13 changes: 0 additions & 13 deletions app/views/server_states/edit.html.erb

This file was deleted.

31 changes: 0 additions & 31 deletions app/views/server_states/index.html.erb

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/server_states/index.json.jbuilder

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/server_states/new.html.erb

This file was deleted.

17 changes: 0 additions & 17 deletions app/views/server_states/show.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/server_states/show.json.jbuilder

This file was deleted.

16 changes: 16 additions & 0 deletions db/migrate/20250306110910_remove_server_states.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

class RemoveServerStates < ActiveRecord::Migration[8.0]
# Create status attribute on servers
# migrate datas to new status (manage up and down)
# drop server state table
# remove changelog entries on serverstate

def up

end

def down

end
end
17 changes: 0 additions & 17 deletions spec/models/server_state_spec.rb

This file was deleted.

52 changes: 0 additions & 52 deletions test/controllers/server_states_controller_test.rb

This file was deleted.

7 changes: 0 additions & 7 deletions test/fixtures/server_states.yml

This file was deleted.

Loading