Class: Ronin::DB::OrganizationMember

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Model
Defined in:
lib/ronin/db/organization_member.rb

Overview

Represents a member of an Organization.

Since:

  • 0.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

included

Instance Attribute Details

#activeBoolean

Specifies whether the member is active or not.

Returns:

  • (Boolean)


49
# File 'lib/ronin/db/organization_member.rb', line 49

attribute :active, :boolean, default: true

#created_atTime (readonly)

Tracks when the member was first created.

Returns:

  • (Time)


116
# File 'lib/ronin/db/organization_member.rb', line 116

attribute :created_at, :datetime

#departmentDepartment?

The department that belongs to within the organization.

Returns:

  • (Department, nil)


92
# File 'lib/ronin/db/organization_member.rb', line 92

belongs_to :department, optional: true

#email_addressEmailAddress?

The member's organization email address.

Returns:



104
# File 'lib/ronin/db/organization_member.rb', line 104

belongs_to :email_address, optional: true

#idInteger

Primary key of the member.

Returns:

  • (Integer)


43
# File 'lib/ronin/db/organization_member.rb', line 43

attribute :id, :integer

#organizationOrganization

The organization that the member belongs to.

Returns:



98
# File 'lib/ronin/db/organization_member.rb', line 98

belongs_to :organization

#personPerson

The person that belongs to the organization.

Returns:



86
# File 'lib/ronin/db/organization_member.rb', line 86

belongs_to :person

#phone_numberEmailAddress?

The member's organization phone number.

Returns:



110
# File 'lib/ronin/db/organization_member.rb', line 110

belongs_to :phone_number, optional: true

#rankString?

The member's rank.

Returns:

  • (String, nil)


80
# File 'lib/ronin/db/organization_member.rb', line 80

attribute :rank, :string

#roleString?

The member's role within the organization.

Returns:

  • (String, nil)


68
# File 'lib/ronin/db/organization_member.rb', line 68

attribute :role, :string

#titleString?

The member's title.

Returns:

  • (String, nil)


74
# File 'lib/ronin/db/organization_member.rb', line 74

attribute :title, :string

#type"advisor", ...

The type of organization membership.

Returns:

  • ("advisor", "volunteer", "employee", "contractor", "intern", "board_member", nil)


55
56
57
58
59
60
61
62
# File 'lib/ronin/db/organization_member.rb', line 55

enum :type, {
  advisor:      'advisor',
  volunteer:    'volunteer',
  employee:     'employee',
  contractor:   'contractor',
  intern:       'intern',
  board_member: 'board member'
}

#updated_atTime (readonly)

Tracks when the member was last updated.

Returns:

  • (Time)


122
# File 'lib/ronin/db/organization_member.rb', line 122

attribute :updated_at, :datetime

Class Method Details

.activeArray<Member>

Queries members that are currently active.

Returns:

  • (Array<Member>)

Since:

  • 0.2.0



129
130
131
# File 'lib/ronin/db/organization_member.rb', line 129

def self.active
  where(active: true)
end

.formerArray<Member>

Queries former members.

Returns:

  • (Array<Member>)

Since:

  • 0.2.0



138
139
140
# File 'lib/ronin/db/organization_member.rb', line 138

def self.former
  where(active: false)
end

Instance Method Details

#to_sString

Converts the organization member to a String.

Returns:

  • (String)

Since:

  • 0.2.0



147
148
149
# File 'lib/ronin/db/organization_member.rb', line 147

def to_s
  person.to_s
end