Class: Ronin::DB::Organization
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::Organization
- Includes:
- Model, Model::HasName, Model::Importable
- Defined in:
- lib/ronin/db/organization.rb
Overview
Represents an Company.
Instance Attribute Summary collapse
-
#created_at ⇒ Time
readonly
Tracks when the organization was first created.
-
#customer_organizations ⇒ Array<Organization>
The other customer organizations (B2B) of the organization.
-
#customers ⇒ Array<Person>
The individual customers (B2C) of the organization/.
-
#departments ⇒ Array<OrganizationDepartment>
The associated departments of the organization.
-
#host_names ⇒ Array<HostName>
The host names that the organization owns.
-
#id ⇒ Integer
Primary key of the organization.
-
#ip_addresses ⇒ Array<IPAddress>
The IP addresses that the organization owns.
-
#member_email_addresses ⇒ Array<EmailAddress>
The email addresses used by members of the organization.
-
#members ⇒ Array<OrganizationMember>
The members that belong to the organization.
-
#notes ⇒ Array<Note>
The associated notes.
-
#organization_customers ⇒ Array<OrganizationCustomer>
The organization's customer relationships.
-
#organization_email_addresses ⇒ Array<EmailAddress>
The email addresses directly associated directly with the organization.
-
#organization_host_names ⇒ Array<OrganizationHostName>
The association of organizations and host names.
-
#organization_ip_addresses ⇒ Array<OrganizationIPAddress>
The association of organizations and IP addresses.
-
#organization_phone_numbers ⇒ Array<OrganizationPhoneNumber>
The association of phone numbers associated with the organization.
-
#organization_street_addresses ⇒ Array<OrganizationStreetAddress>
The association of street addresses associated with the organization.
-
#parent ⇒ Organization?
The optional parent organization.
-
#phone_numbers ⇒ Array<PhoneNumber>
The phone numbers that are associated with the organization.
-
#street_addresses ⇒ Array<StreetAddress>
The street addresses that are associated with the organization.
-
#type ⇒ "company", ...
The type for the organization.
-
#vendor_relationships ⇒ Array<OrganizationCustomer>
The organization's vendor relationships with other organizations.
-
#vendors ⇒ Array<Organization>
The vendor companies that the organization is a customer of.
Attributes included from Model::HasName
Class Method Summary collapse
-
.import(name) ⇒ Organization
Imports an organization.
-
.lookup(name) ⇒ Organization?
Looks up the organization.
Methods included from Model::Importable
Methods included from Model::HasName
Methods included from Model
Instance Attribute Details
#created_at ⇒ Time (readonly)
Tracks when the organization was first created
63 |
# File 'lib/ronin/db/organization.rb', line 63 attribute :created_at, :datetime |
#customer_organizations ⇒ Array<Organization>
The other customer organizations (B2B) of the organization.
177 |
# File 'lib/ronin/db/organization.rb', line 177 has_many :customer_organizations, through: :organization_customers |
#customers ⇒ Array<Person>
The individual customers (B2C) of the organization/
169 |
# File 'lib/ronin/db/organization.rb', line 169 has_many :customers, through: :organization_customers |
#departments ⇒ Array<OrganizationDepartment>
The associated departments of the organization.
133 134 |
# File 'lib/ronin/db/organization.rb', line 133 has_many :departments, class_name: 'OrganizationDepartment', dependent: :destroy |
#host_names ⇒ Array<HostName>
The host names that the organization owns.
211 |
# File 'lib/ronin/db/organization.rb', line 211 has_many :host_names, through: :organization_host_names |
#id ⇒ Integer
Primary key of the organization
45 |
# File 'lib/ronin/db/organization.rb', line 45 attribute :id, :integer |
#ip_addresses ⇒ Array<IPAddress>
The IP addresses that the organization owns.
228 |
# File 'lib/ronin/db/organization.rb', line 228 has_many :ip_addresses, through: :organization_ip_addresses |
#member_email_addresses ⇒ Array<EmailAddress>
The email addresses used by members of the organization.
150 151 |
# File 'lib/ronin/db/organization.rb', line 150 has_many :member_email_addresses, through: :members, source: :email_address |
#members ⇒ Array<OrganizationMember>
The members that belong to the organization.
142 |
# File 'lib/ronin/db/organization.rb', line 142 has_many :members, class_name: 'OrganizationMember' |
#notes ⇒ Array<Note>
The associated notes.
236 |
# File 'lib/ronin/db/organization.rb', line 236 has_many :notes, dependent: :destroy |
#organization_customers ⇒ Array<OrganizationCustomer>
The organization's customer relationships.
159 160 161 |
# File 'lib/ronin/db/organization.rb', line 159 has_many :organization_customers, class_name: 'OrganizationCustomer', foreign_key: :vendor_id, dependent: :destroy |
#organization_email_addresses ⇒ Array<EmailAddress>
The email addresses directly associated directly with the organization.
116 |
# File 'lib/ronin/db/organization.rb', line 116 has_many :organization_email_addresses, dependent: :destroy |
#organization_host_names ⇒ Array<OrganizationHostName>
The association of organizations and host names.
203 |
# File 'lib/ronin/db/organization.rb', line 203 has_many :organization_host_names, dependent: :destroy |
#organization_ip_addresses ⇒ Array<OrganizationIPAddress>
The association of organizations and IP addresses.
219 220 |
# File 'lib/ronin/db/organization.rb', line 219 has_many :organization_ip_addresses, class_name: 'OrganizationIPAddress', dependent: :destroy |
#organization_phone_numbers ⇒ Array<OrganizationPhoneNumber>
The association of phone numbers associated with the organization.
99 |
# File 'lib/ronin/db/organization.rb', line 99 has_many :organization_phone_numbers, dependent: :destroy |
#organization_street_addresses ⇒ Array<OrganizationStreetAddress>
The association of street addresses associated with the organization.
83 |
# File 'lib/ronin/db/organization.rb', line 83 has_many :organization_street_addresses, dependent: :destroy |
#parent ⇒ Organization?
The optional parent organization.
71 72 |
# File 'lib/ronin/db/organization.rb', line 71 belongs_to :parent, optional: true, class_name: 'Organization' |
#phone_numbers ⇒ Array<PhoneNumber>
The phone numbers that are associated with the organization.
107 |
# File 'lib/ronin/db/organization.rb', line 107 has_many :phone_numbers, through: :organization_phone_numbers |
#street_addresses ⇒ Array<StreetAddress>
The street addresses that are associated with the organization.
91 |
# File 'lib/ronin/db/organization.rb', line 91 has_many :street_addresses, through: :organization_street_addresses |
#type ⇒ "company", ...
The type for the organization.
53 54 55 56 57 |
# File 'lib/ronin/db/organization.rb', line 53 enum :type, { company: 'company', government: 'government', military: 'military' }, prefix: 'is_' |
#vendor_relationships ⇒ Array<OrganizationCustomer>
The organization's vendor relationships with other organizations.
185 186 187 |
# File 'lib/ronin/db/organization.rb', line 185 has_many :organization_vendors, class_name: 'OrganizationCustomer', foreign_key: :customer_organization_id, dependent: :destroy |
#vendors ⇒ Array<Organization>
The vendor companies that the organization is a customer of.
195 |
# File 'lib/ronin/db/organization.rb', line 195 has_many :vendors, through: :organization_vendors |
Class Method Details
.import(name) ⇒ Organization
Imports an organization.
268 269 270 |
# File 'lib/ronin/db/organization.rb', line 268 def self.import(name) create(name: name) end |
.lookup(name) ⇒ Organization?
Looks up the organization.
251 252 253 |
# File 'lib/ronin/db/organization.rb', line 251 def self.lookup(name) find_by(name: name) end |