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

Feature/update employee api #218

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 18 additions & 1 deletion app/serializers/api/v1/employee_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,24 @@
module Api
module V1
class EmployeeSerializer < ApiSerializer
attributes :shortname, :firstname, :lastname, :email, :marital_status, :nationalities, :graduation
attributes :shortname,
:firstname,
:lastname,
:email,
:marital_status,
:nationalities,
:graduation,
:city,
:birthday,
:nationalities

attribute :full_name do |employee|
employee.to_s
end

attribute :is_employed do |_employee|
!e.current_employment.nil?
end

attribute :department_shortname do |employee|
employee.department&.shortname
Expand Down
13 changes: 9 additions & 4 deletions doc/development/01_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ PuzzleTime aus dem Git Repository klonen, dazu muss Git installiert sein:

### Setup



Ruby Gem Dependencies installieren (alle folgenden Befehle im PuzzleTime Verzeichnis ausführen):

bundle
Expand All @@ -62,6 +64,9 @@ Starten des Entwicklungsservers:

rails server

***Wichtig*** Um die Standard-DB zu verwenden, muss beim Starten des Servers die folgende ENV-Variable gesetzt werden: `AUTH_DB_ACTIVE=true`


oder gleich aller wichtigen Prozesse:

gem install foreman
Expand All @@ -74,10 +79,10 @@ oder gleich aller wichtigen Prozesse:

| Name | Benutzername | Rolle | Passwort |
| --- | --- | --- | --- |
| Mark Waber | mw | manager | a |
| Andreas Rava | ar | manager | a |
| Pascal Zumkehr | pz | user | a |
| Daniel Illi | di | user | a |
| Mark Waber | MW | manager | a |
| Andreas Rava | AR | manager | a |
| Pascal Zumkehr | PW | user | a |
| Daniel Illi | DI | user | a |

Weitere Employees können in `db/seeds/development/employees.rb` hinzugefügt werden.

Expand Down