Skip to content

Commit

Permalink
issue #477 - Update Skin color at student forms and exclude the Skin …
Browse files Browse the repository at this point in the history
…color model
  • Loading branch information
IgorMonardez committed Aug 15, 2024
1 parent 6b08f20 commit 427783f
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 108 deletions.
7 changes: 0 additions & 7 deletions app/controllers/skin_colors_controller.rb

This file was deleted.

6 changes: 5 additions & 1 deletion app/controllers/students_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StudentsController < ApplicationController
helper :student_majors

UPDATE_FIELDS = [
:name, :photo, :sex, :civil_status, :birthdate, :city, :neighborhood,
:name, :photo, :sex, :civil_status, :skin_color, :birthdate, :city, :neighborhood,
:address, :zip_code, :telephone1, :telephone2, :email, :employer,
:job_position, :cpf, :identity_number, :identity_issuing_body,
:identity_issuing_place, :identity_expedition_date, :birth_country,
Expand Down Expand Up @@ -44,6 +44,10 @@ class StudentsController < ApplicationController
config.columns[:civil_status].options = {
options: ["Solteiro(a)", "Casado(a)"]
}
config.columns[:skin_color].form_ui = :select
config.columns[:skin_color].options = {
options: ["Não declarado", "Branca", "Preta", "Parda", "Amarela", "Indígena"]
}

config.columns[:student_majors].includes = [:majors, :student_majors]

Expand Down
7 changes: 0 additions & 7 deletions app/models/skin_color.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Student < ApplicationRecord
class_name: "Country",
foreign_key: "birth_country_id"
belongs_to :user, optional: true
belongs_to :skin_color, optional: true

has_many :student_majors, dependent: :destroy
has_many :majors, through: :student_majors
Expand Down
1 change: 0 additions & 1 deletion config/locales/navigation.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pt-BR:
notification_log: Notificações Enviadas
custom_variable: Variáveis
report_configuration: Configurações de Relatório
skin_color: Cor de pele

logout:
label: 'Logout'
3 changes: 1 addition & 2 deletions config/navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def can_read?(*args)

config_models = [
User, Role, CustomVariable, Version, Notification,
NotificationLog, ReportConfiguration, EmailTemplate, SkinColor
NotificationLog, ReportConfiguration, EmailTemplate
]
mainhelper.listitem :configurations, config_models do |submenu|
submenu.modelitem User
Expand All @@ -243,7 +243,6 @@ def can_read?(*args)
submenu.modelitem NotificationLog
submenu.modelitem CustomVariable
submenu.modelitem ReportConfiguration
submenu.modelitem SkinColor
end

mainhelper.item :logout, destroy_user_session_path
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20240609002506_add_skin_color_to_student.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddSkinColorToStudent < ActiveRecord::Migration[7.0]
def up
add_column :students, :skin_color, :string
add_column :students, :pcd, :boolean
end
def down
remove_column :students, :skin_color
remove_column :students, :pcd
end
end
19 changes: 0 additions & 19 deletions db/migrate/20240609002506_create_skin_color.rb

This file was deleted.

91 changes: 42 additions & 49 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13269,11 +13269,4 @@
{ name: "Venus", state: State.find_by_code("TO") },
{ name: "Wanderlandia", state: State.find_by_code("TO") },
{ name: "Xambioa", state: State.find_by_code("TO") },
])
SkinColor.create([
{name: "Preta"},
{name: "Branco"},
{name: "Pardo"},
{name: "Indígena"},
{name: "Não declarado"},
])
])
7 changes: 0 additions & 7 deletions spec/factories/factory_skin_color.rb

This file was deleted.

Loading

0 comments on commit 427783f

Please sign in to comment.