Class: ESP::User
- Inherits:
-
Resource
- Object
- ActiveResource::Base
- Resource
- ESP::User
- Defined in:
- lib/esp/resources/user.rb
Class Method Summary collapse
-
.all ⇒ ActiveResource::PaginatedCollection<ESP::User>
Return a paginated User list.
-
.create(attributes = {}) ⇒ ESP::User
Create a User.
-
.find(id, options = {}) ⇒ ESP::User
Find a User by id.
-
.where(clauses = {}) ⇒ ActiveResource::PaginatedCollection<ESP::User>
Return a paginated User list filtered by search parameters.
Instance Method Summary collapse
-
#destroy ⇒ self
Delete a User.
-
#organization ⇒ ESP::Organization
The organization this user belongs to.
-
#role ⇒ ESP::Role
The role assigned to this user.
-
#save ⇒ Boolean
Create and update a User.
-
#sub_organizations ⇒ ActiveResource::PaginatedCollection<ESP::SubOrganization>
The collection of sub organizations that belong to the user.
-
#teams ⇒ ActiveResource::PaginatedCollection<ESP::Team>
The collection of teams that belong to the user.
Methods included from Dirty
#changed_attributes, #original_attributes, #original_attributes=
Methods included from LoadWithOriginalAttributes
Class Method Details
.all ⇒ ActiveResource::PaginatedCollection<ESP::User>
Return a paginated User list
|
# File 'lib/esp/resources/user.rb', line 56
|
.create(attributes = {}) ⇒ ESP::User
Create a User. call-seq -> super.create(attributes={})
|
# File 'lib/esp/resources/user.rb', line 61
|
.find(id, options = {}) ⇒ ESP::User
Find a User by id
call-seq -> super.find(id, options = {})
|
# File 'lib/esp/resources/user.rb', line 40
|
.where(clauses = {}) ⇒ ActiveResource::PaginatedCollection<ESP::User>
Return a paginated User list filtered by search parameters
call-seq -> super.where(clauses = {})
|
# File 'lib/esp/resources/user.rb', line 29
|
Instance Method Details
#destroy ⇒ self
Delete a User.
|
# File 'lib/esp/resources/user.rb', line 85
|
#organization ⇒ ESP::Organization
The organization this user belongs to.
6 |
# File 'lib/esp/resources/user.rb', line 6 belongs_to :organization, class_name: 'ESP::Organization' |
#role ⇒ ESP::Role
The role assigned to this user.
11 |
# File 'lib/esp/resources/user.rb', line 11 belongs_to :role, class_name: 'ESP::Role' |
#save ⇒ Boolean
|
# File 'lib/esp/resources/user.rb', line 73
|
#sub_organizations ⇒ ActiveResource::PaginatedCollection<ESP::SubOrganization>
The collection of sub organizations that belong to the user.
16 17 18 19 |
# File 'lib/esp/resources/user.rb', line 16 def sub_organizations return attributes['sub_organizations'] if attributes['sub_organizations'].present? SubOrganization.where(id_in: sub_organization_ids) end |
#teams ⇒ ActiveResource::PaginatedCollection<ESP::Team>
The collection of teams that belong to the user.
24 25 26 27 |
# File 'lib/esp/resources/user.rb', line 24 def teams return attributes['teams'] if attributes['teams'].present? Team.where(id_in: team_ids) end |