Class: MnoEnterprise::OrgInvite
- Inherits:
-
BaseResource
- Object
- BaseResource
- MnoEnterprise::OrgInvite
- Defined in:
- app/models/mno_enterprise/org_invite.rb
Instance Method Summary collapse
-
#accept!(user = self.user) ⇒ Object
TODO: specs Add the user to the organization and update the status of the invite Add team.
-
#cancel! ⇒ Object
TODO: specs.
-
#expired? ⇒ Boolean
TODO: specs Check whether the invite is expired or not.
- #to_audit_event ⇒ Object
Methods inherited from BaseResource
#==, base_class, #cache_key, #clear_association_cache, #clear_attribute_changes!, exists?, find_by, first, last, #max_updated_column_timestamp, #read_attribute, #reload, #save, #save!, #update, #write_attribute
Methods included from HerExtension::Validations::RemoteUniquenessValidation
Instance Method Details
#accept!(user = self.user) ⇒ Object
TODO: specs Add the user to the organization and update the status of the invite Add team
36 37 38 |
# File 'app/models/mno_enterprise/org_invite.rb', line 36 def accept!(user = self.user) self.put(operation: 'accept', data: { user_id: user.id}) end |
#cancel! ⇒ Object
TODO: specs
41 42 43 |
# File 'app/models/mno_enterprise/org_invite.rb', line 41 def cancel! self.put(operation: 'cancel') end |
#expired? ⇒ Boolean
TODO: specs Check whether the invite is expired or not
47 48 49 |
# File 'app/models/mno_enterprise/org_invite.rb', line 47 def expired? self.status != 'pending' || self.created_at < 3.days.ago end |
#to_audit_event ⇒ Object
51 52 53 |
# File 'app/models/mno_enterprise/org_invite.rb', line 51 def to_audit_event self.attributes.slice(:team_id, :user_role, :user_email, :user_id, :referrer_id, :organization_id) end |