-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajouter un point d'accès correspondant à l'action "index"
- Loading branch information
Showing
3 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
api.array :organizations do | ||
@organizations.each do |organization| | ||
api.organization do | ||
api.id organization.id | ||
api.name organization.name | ||
api.description organization.description | ||
api.parent(:id => organization.parent.id, :name => organization.parent.name) if organization.parent | ||
api.mail organization.mail | ||
api.direction organization.direction | ||
api.name_with_parents organization.name_with_parents | ||
|
||
api.top_department_in_ldap organization.top_department_in_ldap | ||
api.created_at organization.created_at | ||
api.updated_at organization.updated_at | ||
|
||
api.array :users do | ||
organization.users.each do |user| | ||
api.users do | ||
api.id user.id | ||
api.name user.name | ||
api.manager organization.managers.include?(user) | ||
api.team_leader organization.team_leaders.include?(user) | ||
end | ||
end | ||
end if include_in_api_response?('users') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters