Class: Ronin::DB::OrganizationDepartment

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

Overview

Represents a department of an organization.

Since:

  • 0.2.0

Instance Attribute Summary collapse

Attributes included from Model::HasName

#name

Method Summary

Methods included from Model::HasName

included

Methods included from Model

included

Instance Attribute Details

#created_atTime (readonly)

Tracks when the organization was first created

Returns:

  • (Time)


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

attribute :created_at, :datetime

#email_addressEmailAddress?

The optional email address of the department.

Returns:



61
# File 'lib/ronin/db/organization_department.rb', line 61

belongs_to :email_address, optional: true

#membersArray<OrganizationMember>

The members that belong to the department.

Returns:



88
# File 'lib/ronin/db/organization_department.rb', line 88

has_many :members, class_name: 'OrganizationMember'

#organizationOrganization

The organization that the department belongs to.

Returns:



42
# File 'lib/ronin/db/organization_department.rb', line 42

belongs_to :organization

#parent_departmentOrganizationDepartment?

The optional parent department of the subdepartment.

Returns:



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

belongs_to :parent_department, optional:   true,
class_name: 'OrganizationDepartment'

#phone_numberPhoneNumber?

The optional phone number of the department.

Returns:



55
# File 'lib/ronin/db/organization_department.rb', line 55

belongs_to :phone_number, optional: true

#street_addressStreetAddress?

The optional street address of the department.

Returns:



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

belongs_to :street_address, optional: true

#subdepartmentsArray<OrganizationDepartment>

The associated subdepartments of the department.

Returns:



80
81
82
# File 'lib/ronin/db/organization_department.rb', line 80

has_many :subdepartments, class_name:  'OrganizationDepartment',
foreign_key: :parent_department_id,
dependent:   :destroy