Rename #*name to #*_name #69

Merged
dergrimm merged 1 commit from fix-name-variable-names into main 2022-02-25 14:34:19 +00:00
3 changed files with 7 additions and 7 deletions
Showing only changes of commit d6bb1b937d - Show all commits

View file

@ -26,14 +26,14 @@ module Backend
@[GraphQL::Field] @[GraphQL::Field]
# User's first name # User's first name
def firstname : String def first_name : String
find!.firstname find!.first_name
end end
@[GraphQL::Field] @[GraphQL::Field]
# User's last name # User's last name
def lastname : String def last_name : String
find!.lastname find!.last_name
end end
@[GraphQL::Field] @[GraphQL::Field]

View file

@ -36,12 +36,12 @@ module Backend
column admin : Bool = false column admin : Bool = false
# User's first name # User's first name
def firstname : String def first_name : String
Ldap.user(Ldap.uid(@username.not_nil!)).first["givenName"].first Ldap.user(Ldap.uid(@username.not_nil!)).first["givenName"].first
end end
# User's last name # User's last name
def lastname : String def last_name : String
Ldap.user(Ldap.uid(@username.not_nil!)).first["sn"].first Ldap.user(Ldap.uid(@username.not_nil!)).first["sn"].first
end end

View file

@ -1,4 +1,4 @@
Hey, <%= user.firstname %>! Hey, <%= user.first_name %>!
Du wurdest erfolgreich als Lehrer registriert. Du wurdest erfolgreich als Lehrer registriert.
Initialisiere deinen Account, indem du auf den folgenden Link klickst und deine Daten eingibst: Initialisiere deinen Account, indem du auf den folgenden Link klickst und deine Daten eingibst: