-
Notifications
You must be signed in to change notification settings - Fork 20
Feature/947 Every person can edit themselves #1002
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: feature/946-setup-cancancan
Are you sure you want to change the base?
Feature/947 Every person can edit themselves #1002
Conversation
0532487
to
83da19f
Compare
6edce74
to
ba30b19
Compare
PersonRoleLevel.find_by(level: role[:role_level])&.id || PersonRoleLevel.first.id | ||
end | ||
|
||
def update_person_with_auth_user_id |
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.
Maybe rename this to something like set_auth_user_id_on_person
?
|
||
def update_person_with_auth_user_id | ||
ldap_username = @ptime_employee_attributes[:ldapname] | ||
@person.auth_user_id = AuthUser.find_by(ldap_username:)&.id |
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.
Probably use find_by!
here so the transaction fails if the AuthUser is not found.
@@ -0,0 +1,5 @@ | |||
class AddAuthUserIdToPeople < ActiveRecord::Migration[8.0] |
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.
You could combine both migrations to one
@@ -0,0 +1,5 @@ | |||
class AddAuthUserIdToPeople < ActiveRecord::Migration[8.0] | |||
def change | |||
add_column :people, :auth_user_id, :integer, foreign_key: { to_table: :people } |
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.
You should probably also add belongs_to
and has_one
to people and auth_users respectively.
See: https://guides.rubyonrails.org/association_basics.html
|
||
click_link('Bearbeiten', href: edit_person_path(ursula)) | ||
fill_in 'person_title', with: 'Expert at access control' | ||
save_button = find_button("Person aktualisieren") |
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.
There is a click_button
method
No description provided.