-
Notifications
You must be signed in to change notification settings - Fork 16
Issue 401 #557
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
base: develop
Are you sure you want to change the base?
Conversation
…for role validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Além dos comentários que coloquei nas alterações:
O seeds não está funcionando. Tem um uso de user.role = Role.find_by_name("Administrador")
que não funciona mais
@@ -0,0 +1,5 @@ | |||
class RemoveRoleIdFromUser < ActiveRecord::Migration[7.0] | |||
def change | |||
remove_column :users, :role_id, :integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O rollback aqui está errado. Tive um problema de validação na migration seguinte (por ter essa parte de usuários bem bagunçada em desenvolvimento) e não consegui dar rollback para uma versão funcionando.
Só restaurar a coluna role_id não é o suficiente: é preciso pegar de UserRole
@@ -137,6 +139,13 @@ | |||
concerns :active_scaffold | |||
end | |||
|
|||
resources :user_roles do | |||
concerns :active_scaffold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esse concerns faz sentido? Não tem o bloco do active scaffold no user roles...
Por consistência, acho que seria bom adicionar o bloco lá (ao invés de tirar o concerns daqui), mesmo que a rota pra user_roles não fique visivel no menu de navegação
@@ -41,7 +41,10 @@ | |||
<% end %> | |||
</div> | |||
<div id="sub"> | |||
Versão <%= APP_VERSION %> | <%= link_to 'Créditos', credits_show_path %> | |||
Versão <%= APP_VERSION %> | <%= link_to 'Créditos', credits_show_path %> | |||
<div id="role_selector" style="padding-left: 90px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Será que não dá pra ajustar esses elementos para deixar o combo colado na direita? Provavelmente tem que fazer outros ajustes também, como deixar o campo de texto que está solto com a versão em uma div, mas me parece algo que dá pra resolver com flex do css
app/models/user.rb
Outdated
scope :professors, -> { where(role_id: Role::ROLE_PROFESSOR) } | ||
scope :coordination, -> { where(role_id: Role::ROLE_COORDENACAO) } | ||
scope :secretary, -> { where(role_id: Role::ROLE_SECRETARIA) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essas consultas estão quebradas. Elas são usadas na parte de Seleção -> Comitês -> Adicionar com os links "Adicionar todos [professores|coordenação|secretaria]"
app/models/enrollment.rb
Outdated
user = User.invite!({ | ||
email: student.first_email, | ||
name: student.name, | ||
role_id: Role::ROLE_ALUNO | ||
actual_role: Role::ROLE_ALUNO | ||
}, current_user) do |invitable| | ||
invitable.skip_confirmation! | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esse usuário está sendo criado sem papel em UserRole. Só o actual_role está sendo preenchido
…es, addition of a new hidden page /user_roles
…tion related to user and professor/student
…cations of this Issue
No description provided.