Class: Employee

Overview

Employee model — core HR entity (profile, time-off, scheduling, CRM).
== Schema Information

Table name: parties
Database name: primary

id :integer not null, primary key
activities_count :integer default(0)
affiliations :text default([]), is an Array
annual_revenue :integer
authorization_code_required :boolean
available_credit :decimal(14, 2) default(0.0)
banner :text
best_time_to_call :string(255)
bill_shipping_to_customer :boolean
calculate_profiling :boolean default(FALSE), not null
can_pay_by_cod_business_check :boolean
consent_preferences :jsonb
contact_roles :string(255) is an Array
creation_method :integer default("crm"), not null
credit_limit :decimal(8, 2) default(0.0)
credit_score :integer
credit_score_date :datetime
currency :string(255)
default_payment_method :string
do_not_auto_assign :boolean default(FALSE), not null
dob :date
early_payment_discount :integer
early_payment_timescale :integer
estimated_landed_cost_ptg :float
force_logout :boolean default(FALSE), not null
full_name :string(255)
full_name_tsv :tsvector
gclid :string
gender :string(1)
inactive :boolean default(FALSE), not null
job_title :string(255)
lead_time :integer
lead_time_override :integer
lead_verification_score :integer
lead_verified_at :datetime
merged_from_ids :integer is an Array
name1 :string(255)
name2 :string(255)
name3 :string(255)
number_of_employees :integer
number_of_offices :string
on_hold :boolean default(FALSE), not null
on_hold_reason :text
open_sales_activity :boolean default(FALSE), not null
ordering_instructions :text
preferred_language :string
preferred_shipping_method :string(255)
prefix :string(10)
profile_info :text
projects_per_year :string
purchase_order_required :boolean default(FALSE), not null
qc_orders :boolean default(TRUE), not null
rating :string(255)
report_grouping :string(255)
requires_rma_reference :boolean
sales_priority_index :integer default(0)
send_statement :boolean default(FALSE), not null
send_statement_reason :string(255)
shipment_instructions :text
source_info :text
spiff_enrolled :boolean
state :string(255)
state_code :string(255)
suffix :string(10)
terms :string(255)
timezone_name :string
type :string(255)
uploads_count :integer default(0)
uuid :uuid not null
verbal_po :boolean default(FALSE), not null
watch :integer
created_at :datetime
updated_at :datetime
active_spiff_enrollment_id :integer
billing_address_id :integer
bot_id :string
business_unit_id :integer
buying_group_id :integer
catalog_id :integer
company_id :integer
creator_id :integer
customer_id :integer
gl_offset_account_id :integer
ledger_detail_project_id :integer
legacy_tier2_program_pricing_id :integer
local_sales_rep_id :integer
mailing_address_id :integer
original_source_id :integer
parent_id :integer
paypal_vault_customer_id :string
paypal_vault_token_id :string
primary_sales_rep_id :integer
profile_id :integer
profile_image_id :integer
secondary_sales_rep_id :integer
service_rep_id :integer
shipping_address_id :integer
source_id :integer
spiff_address_id :integer
spiff_payable_id :integer
stripe_customer_id :string
tier2_program_pricing_id :integer
updater_id :integer
visit_id :bigint

Indexes

idx_parties_full_name_trg (full_name) USING gin
idx_party_main_address (COALESCE(shipping_address_id, billing_address_id, mailing_address_id))
idx_state_type (state,type)
idx_type_billing_address_id (type,billing_address_id)
idx_type_creation_method_state (type,creation_method,state)
idx_type_customer_id (type,customer_id)
idx_type_id_credit_limit (type,id,credit_limit)
idx_type_inactive (type,inactive)
idx_type_primary_sales_rep_id_watch (type,primary_sales_rep_id,watch)
index_parties_on_affiliations (affiliations) USING gin
index_parties_on_billing_address_id (billing_address_id)
index_parties_on_bot_id (bot_id) WHERE (bot_id IS NOT NULL)
index_parties_on_catalog_id (catalog_id)
index_parties_on_company_id (company_id)
index_parties_on_full_name_tsv (full_name_tsv) USING gin
index_parties_on_gclid (gclid) WHERE (gclid IS NOT NULL)
index_parties_on_local_sales_rep_id (local_sales_rep_id)
index_parties_on_mailing_address_id (mailing_address_id)
index_parties_on_merged_from_ids (merged_from_ids) USING gin
index_parties_on_open_sales_activity (open_sales_activity)
index_parties_on_parent_id (parent_id)
index_parties_on_primary_sales_rep_id (primary_sales_rep_id)
index_parties_on_profile_image_id (profile_image_id) USING hash
index_parties_on_report_grouping (report_grouping)
index_parties_on_secondary_sales_rep_id (secondary_sales_rep_id)
index_parties_on_service_rep_id (service_rep_id)
index_parties_on_source_id (source_id)
index_parties_on_tier2_program_pricing_id (tier2_program_pricing_id)
index_parties_on_uuid (uuid) UNIQUE
index_parties_on_visit_id (visit_id) WHERE (visit_id IS NOT NULL) USING hash
index_parties_on_watch (watch)
parties_buying_group_id_idx (buying_group_id)
parties_customer_id_index (customer_id)
parties_profile_id_idx (profile_id)
parties_shipping_address_id_idx (shipping_address_id)
parties_spiff_address_id_idx (spiff_address_id)
parties_spiff_payable_id_idx (spiff_payable_id)

Foreign Keys

fk_rails_... (profile_image_id => digital_assets.id) ON DELETE => nullify
fk_rails_... (source_id => sources.id)
fk_rails_... (visit_id => visits.id) ON DELETE => nullify
parties_billing_address_id_fk (billing_address_id => addresses.id) ON DELETE => nullify
parties_buying_group_id_fk (buying_group_id => buying_groups.id)
parties_catalog_id_fk (catalog_id => catalogs.id)
parties_company_id_fk (company_id => companies.id)
parties_customer_id_fk (customer_id => parties.id) ON DELETE => cascade
parties_mailing_address_id_fk (mailing_address_id => addresses.id) ON DELETE => nullify
parties_parent_id_fk (parent_id => parties.id) ON DELETE => nullify
parties_primary_sales_rep_id_fk (primary_sales_rep_id => parties.id) ON DELETE => nullify
parties_profile_id_fk (profile_id => profiles.id)
parties_secondary_sales_rep_id_fk (secondary_sales_rep_id => parties.id) ON DELETE => nullify
parties_shipping_address_id_fk (shipping_address_id => addresses.id) ON DELETE => nullify
parties_source_id_fk (source_id => sources.id)
parties_spiff_address_id_fk (spiff_address_id => addresses.id) ON DELETE => nullify
parties_spiff_payable_id_fk (spiff_payable_id => parties.id) ON DELETE => nullify
parties_tier2_program_pricing_id_fk (tier2_program_pricing_id => coupons.id)

Defined Under Namespace

Classes: BirthdayMessage, WorkAnniversaryMessage

Constant Summary collapse

SCOTT =
82
SALES_REP_ASSIGNMENT_WEIGHTS =
[0, 1, 2, 3].freeze
FULL_DAY_IN_SECONDS =
25_200

Constants inherited from Party

Party::PREFERRED_LANGUAGES

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Instance Attribute Summary collapse

Attributes inherited from Party

#creation_method

Belongs to collapse

Methods inherited from Party

#catalog, #company, #customer, #gl_offset_account, #profile_image, #visit

Methods included from Models::Auditable

#creator, #updater

Has one collapse

Methods inherited from Party

#account, #store

Has many collapse

Methods inherited from Party

#accounts, #addresses, #agreement_participants, #agreements, #assistant_conversations, #billing_credit_memos, #consignment_stores, #contact_points, #contacts, #credit_memos, #destination_call_logs, #destination_call_records, #inbound_communications, #notifications, #opportunity_participants, #origin_call_logs, #origin_call_records, #outbound_communications, #outgoing_payments, #party_topics, #purchase_orders, #queue_call_logs, #receipts, #recipient_sms_messages, #room_plans, #sender_sms_messages, #support_case_participants, #support_cases, #uploads, #visit_events, #visits, #voucher_items, #vouchers

Delegated Instance Attributes collapse

Methods inherited from Party

#can?, #cannot?, #is_sales_rep?, #locale, #main_address

Class Method Summary collapse

Methods included from EmployeeDisplay

#assigned_or_requested_employee_topics, #check_online, #check_pto, #company_phone, #country, #days_until_birthday, #default_printer_profile, #direct_phone, #employee_work_schedule, #locale, #name_and_email, #name_and_extension, #name_and_fax, #name_and_phone, #name_with_paired, #online?, #open_employee_goals, #open_employee_reviews, #reference_number, #sales_rep?, #short_name, #signature, #sms_enabled?, #sms_enabled_numbers, #start_year_at_warmlyyours, #state_code, #store, #tech_rep?, #time_off?, #time_off_budget, #to_liquid, #unescheduled_on_day?, #versions_for_audit_trail, #work_schedule?, #work_timezone, #years_at_warmlyyours

Methods included from EmployeeManagement

#current_review, #drop_customer_event, #manages, #manages?, #manages_and_self, #manages_ids, #role_cleanup, #schema_dot_org_structure, #to_json_ld

Methods included from EmployeeWatchList

#effective_watch_list_ids, #monitor_group_sms_numbers=, #monitor_unlinked_extensions=, #selected_watch_list_employee_ids, #selected_watch_list_employee_ids=, #selected_watch_list_role_ids, #selected_watch_list_role_ids=, #selected_watch_list_roles_employees, #watch_list

Methods included from EmployeePhonePresence

#auto_away_after, #pbx_did, #pbx_did_contact_point, #pbx_extension, #presence, #presence_timestamp, #set_presence, #sub_presence, #working_from_home?, #working_from_home_number

Methods included from EmployeeSelectOptions

#manager_select_options, #manages_and_self_select_options

Methods included from EmployeeWorkStatus

#active_work_schedule, #capacity_ratio, #current_company_holidays_array, #day_employee_events, #day_status_employee_event, #day_status_holiday_check, #day_status_work_schedule, #employee_events_loaded, #next_business_day, #next_business_day_closing_time, #next_working_day, #preload_time_off_events, #preload_working_hours, #work_status_on_day, #working_hours_on_date, #working_on_day?

Methods included from EmployeeActivityCapacity

#activity_load_on_day, #can_take_activities_on_day?, #maximum_activities_per_day, #maximum_priority_tier_activities_per_day, #maximum_standard_tier_activities_per_day, #priority_tier_activities_ratio

Methods included from EmployeeTimeOffAccruals

#current_time_off_policy_for, #process_accruals, #process_work_schedule_transitions

Methods included from EmployeeTimeOffRollover

#process_policy_transitions, #process_rollover_and_expiry

Methods included from EmployeeTimeOffDeductions

#process_time_off_requests

Methods included from Models::Lineage

#ancestors, #ancestors_ids, #children_and_roots, #descendants, #descendants_ids, #ensure_non_recursive_lineage, #family_members, #generate_full_name, #generate_full_name_array, #lineage, #lineage_array, #lineage_simple, #root, #root_id, #self_ancestors_and_descendants, #self_ancestors_and_descendants_ids, #self_and_ancestors, #self_and_ancestors_ids, #self_and_children, #self_and_descendants, #self_and_descendants_ids, #self_and_siblings, #self_and_siblings_ids, #siblings, #siblings_ids

Methods inherited from Party

#digital_assets, #linked_activities, #product_lines, #set_full_name, #set_state_code, #set_timezone

Methods included from CrmLinkable

#crm_link, #crm_link_with_host

Methods included from PartyAccount

#ability, #build_account, #create_account, #online_account_invite, #refuse_silent_account_replacement!, search_for_authenticable_linked_party_by_email

Methods included from PartyCart

#all_uploads, #assign_chained_activities?, #cart, #cart=, #cart?, #cart_id, #cart_info, #create_activity, #create_quote_builder_project, #load_cart, #store_original_source

Methods included from PartyIdentity

#active?, #admin?, #aka, #aka=, #all_activities, #blog_admin?, #broadcast_product_interest_changed, #can_be_certified?, #can_list_all_contact_resources?, #clear_individual_names, #clear_names, #contact?, #customer?, #determine_company_id, #direct_commercial?, #direct_pro?, #employee?, #first_name, #first_name=, #guest_individual_name?, #guest_name?, #homeowner?, #id_and_name, #last_name, #last_name=, #manager?, #middle_name, #middle_name=, #name, #name=, #organization?, #person?, #primary_party, #public_facing_full_name, #public_facing_full_name=, #show_name_four, #to_s, #update_product_interests

Methods included from PartyAddresses

#addresses_options_for_select, #can_change_country?, #catalog_country, #catalog_country_iso, #catalog_country_iso3, #city, #country, #country_iso, #country_iso3, #first_address, #flag, #location_name, #most_recent_visit, #new_address, #store, #street1, #street2, #street3, #timezone, #unique_addresses, #visit_data, #visit_location, #zip

Methods included from PartyContactInfo

#all_support_cases, #call_records?, #cell_phone, #cell_phone=, #cell_phone_formatted, #contact_point_options_for_select, #contactable?, #email, #email=, #email_options_for_select, #email_with_name, #emails, #fax, #fax=, #fax_formatted, #fax_options_for_select, #first_callable_contact_point, #first_contact_point_by_category, #phone, #phone=, #phone_formatted, #phone_options_for_select, #set_email_from_account, #set_primary_contact_point, #sms_enabled_numbers, #sms_messages, #tracking_email_address, #tracking_email_prefix, #website, #website=, #website_options_for_select

Methods included from PartySearch

active, address_search, customer_or_contact, email_search, inactive, lookup, phone_search, searchable, with_main_address

Methods included from Models::Notable

#quick_note

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #should_not_save_version, #stamp_record

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#full_nameObject (readonly)



297
# File 'app/models/employee.rb', line 297

validates :full_name, presence: { message: 'must be specified for this employee.' }

Class Method Details

.active_employeesActiveRecord::Relation<Employee>

A relation of Employees that are active employees. Active Record Scope

Returns:

See Also:



250
# File 'app/models/employee.rb', line 250

scope :active_employees, -> { where(inactive: false).where(Party[:full_name].not_eq('www.warmlyyours.com')) }

.blog_employeesActiveRecord::Relation<Employee>

A relation of Employees that are blog employees. Active Record Scope

Returns:

See Also:



249
# File 'app/models/employee.rb', line 249

scope :blog_employees, -> { where(Party[:full_name].not_eq('www.warmlyyours.com')) }

.by_direct_roleActiveRecord::Relation<Employee>

A relation of Employees that are by direct role. Active Record Scope

Returns:

See Also:



246
# File 'app/models/employee.rb', line 246

scope :by_direct_role, ->(role_name) { joins(account: :roles).where(roles: { name: role_name }) }

.by_direct_role_idActiveRecord::Relation<Employee>

A relation of Employees that are by direct role id. Active Record Scope

Returns:

See Also:



247
# File 'app/models/employee.rb', line 247

scope :by_direct_role_id, ->(role_id) { joins(account: :roles).where('roles.id': role_id) }

.by_roleActiveRecord::Relation<Employee>

A relation of Employees that are by role. Active Record Scope

Returns:

See Also:



238
# File 'app/models/employee.rb', line 238

scope :by_role, ->(role_names) { by_role_id(Role.where(name: role_names).pluck(:id)) }

.by_role_idActiveRecord::Relation<Employee>

A relation of Employees that are by role id. Active Record Scope

Returns:

See Also:



239
240
241
242
243
244
245
# File 'app/models/employee.rb', line 239

scope :by_role_id, lambda { |role_ids|
  if role_ids.present?
    where('exists(select 1 from accounts_roles ar inner join accounts a on a.id = ar.account_id where a.party_id = parties.id and ar.role_id in (?))', Role.self_and_ancestors_ids(role_ids))
  else
    none
  end
}

.engineersActiveRecord::Relation<Employee>

A relation of Employees that are engineers. Active Record Scope

Returns:

See Also:



260
# File 'app/models/employee.rb', line 260

scope :engineers, -> { by_role('engineering_rep') }

.from_cadActiveRecord::Relation<Employee>

A relation of Employees that are from cad. Active Record Scope

Returns:

See Also:



275
# File 'app/models/employee.rb', line 275

scope :from_cad, -> { where(company_id: 2) }

.from_indActiveRecord::Relation<Employee>

A relation of Employees that are from ind. Active Record Scope

Returns:

See Also:



276
# File 'app/models/employee.rb', line 276

scope :from_ind, -> { where(company_id: 3) }

.from_ndlActiveRecord::Relation<Employee>

A relation of Employees that are from ndl. Active Record Scope

Returns:

See Also:



277
# File 'app/models/employee.rb', line 277

scope :from_ndl, -> { where(company_id: 4) }

.from_usaActiveRecord::Relation<Employee>

A relation of Employees that are from usa. Active Record Scope

Returns:

See Also:



274
# File 'app/models/employee.rb', line 274

scope :from_usa, -> { where(company_id: 1) }

.in_sales_rep_assignment_queueActiveRecord::Relation<Employee>

A relation of Employees that are in sales rep assignment queue. Active Record Scope

Returns:

See Also:



252
253
254
# File 'app/models/employee.rb', line 252

scope :in_sales_rep_assignment_queue, lambda { |store_country, type_sym|
  active_employees.where("parties.sales_rep_assignment_weight_#{store_country.downcase}_#{type_sym} in (1,2,3)")
}

.inactive_employeesActiveRecord::Relation<Employee>

A relation of Employees that are inactive employees. Active Record Scope

Returns:

See Also:



251
# File 'app/models/employee.rb', line 251

scope :inactive_employees, -> { where(inactive: true) }

.local_sales_repsActiveRecord::Relation<Employee>

A relation of Employees that are local sales reps. Active Record Scope

Returns:

See Also:



263
# File 'app/models/employee.rb', line 263

scope :local_sales_reps, -> { joins(:employee_record).where(employee_records: { local_sales_rep: true }) }

.phone_enabledActiveRecord::Relation<Employee>

A relation of Employees that are phone enabled. Active Record Scope

Returns:

See Also:



265
# File 'app/models/employee.rb', line 265

scope :phone_enabled, -> { joins(:employee_phone_status) }

.primary_sales_repsActiveRecord::Relation<Employee>

A relation of Employees that are primary sales reps. Active Record Scope

Returns:

See Also:



261
# File 'app/models/employee.rb', line 261

scope :primary_sales_reps, -> { joins(:employee_record).where(employee_records: { primary_sales_rep: true }) }

.ransackable_scopes(_auth_object = nil) ⇒ Object



304
305
306
# File 'app/models/employee.rb', line 304

def self.ransackable_scopes(_auth_object = nil)
  [:with_strengh_in_top_five]
end

.sales_repsActiveRecord::Relation<Employee>

A relation of Employees that are sales reps. Active Record Scope

Returns:

See Also:



259
# File 'app/models/employee.rb', line 259

scope :sales_reps, -> { joins(:employee_record).where('true IN (primary_sales_rep,secondary_sales_rep,local_sales_rep)') }

.secondary_sales_repsActiveRecord::Relation<Employee>

A relation of Employees that are secondary sales reps. Active Record Scope

Returns:

See Also:



262
# File 'app/models/employee.rb', line 262

scope :secondary_sales_reps, -> { joins(:employee_record).where(employee_records: { secondary_sales_rep: true }) }

.sortedActiveRecord::Relation<Employee>

A relation of Employees that are sorted. Active Record Scope

Returns:

See Also:



248
# File 'app/models/employee.rb', line 248

scope :sorted, -> { order(:full_name) }

.technical_support_repsActiveRecord::Relation<Employee>

A relation of Employees that are technical support reps. Active Record Scope

Returns:

See Also:



264
# File 'app/models/employee.rb', line 264

scope :technical_support_reps, -> { by_direct_role(%w[technical_support_rep technical_support_manager]) }

.with_associationsActiveRecord::Relation<Employee>

A relation of Employees that are with associations. Active Record Scope

Returns:

See Also:



255
# File 'app/models/employee.rb', line 255

scope :with_associations, -> { includes({ account: :roles }, :contact_points, employee_record: :strength_themes) }

.with_open_activitiesActiveRecord::Relation<Employee>

A relation of Employees that are with open activities. Active Record Scope

Returns:

See Also:



256
257
258
# File 'app/models/employee.rb', line 256

scope :with_open_activities, lambda {
  where('exists(select 1 from activities a where a.assigned_resource_id = parties.id and a.activity_type_id IS NOT NULL and a.activity_result_type_id IS NULL)')
}

.with_strengh_in_top_fiveActiveRecord::Relation<Employee>

A relation of Employees that are with strengh in top five. Active Record Scope

Returns:

See Also:



266
267
268
269
270
271
272
273
# File 'app/models/employee.rb', line 266

scope :with_strengh_in_top_five, lambda { |*clifton_strength_ids|
  ids = clifton_strength_ids.filter_map(&:presence).uniq
  where(
    'exists(select 1 from strength_themes st inner join employee_records er on er.id = st.employee_record_id ' \
    'inner join parties p on p.id = er.party_id where p.id = parties.id and st.priority <= 5 and st.clifton_strength_id IN (?))',
    ids
  )
}

Instance Method Details

#activitiesActiveRecord::Relation<Activity>

Returns:

See Also:



202
# File 'app/models/employee.rb', line 202

has_many :activities, foreign_key: 'assigned_resource_id', dependent: :nullify, inverse_of: :assigned_resource

#authored_postsActiveRecord::Relation<Post>

Returns:

  • (ActiveRecord::Relation<Post>)

See Also:



227
# File 'app/models/employee.rb', line 227

has_many :authored_posts, class_name: 'Post', foreign_key: :user_id, inverse_of: :user, dependent: :nullify

#billing_addressAddress

Returns:

See Also:



193
# File 'app/models/employee.rb', line 193

belongs_to :billing_address, class_name: 'Address', optional: true

Alias for Employee_record#calendly_link

Returns:

  • (Object)

    Employee_record#calendly_link

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#certificationsObject

Alias for Employee_record#certifications

Returns:

  • (Object)

    Employee_record#certifications

See Also:



232
# File 'app/models/employee.rb', line 232

has_many :certifications, foreign_key: 'party_id', dependent: :destroy, inverse_of: :party

#course_enrollmentsActiveRecord::Relation<CourseEnrollment>

Returns:

See Also:



231
# File 'app/models/employee.rb', line 231

has_many :course_enrollments, foreign_key: 'party_id', dependent: :destroy, inverse_of: :party

#created_rmasActiveRecord::Relation<Rma>

Returns:

  • (ActiveRecord::Relation<Rma>)

See Also:



228
# File 'app/models/employee.rb', line 228

has_many :created_rmas, class_name: 'Rma', foreign_key: :creator_id, dependent: :nullify, inverse_of: :creator

#customer_drop_eventsActiveRecord::Relation<CustomerDropEvent>

Returns:

See Also:



213
# File 'app/models/employee.rb', line 213

has_many :customer_drop_events, dependent: :destroy, foreign_key: 'sales_rep_id', inverse_of: :employee

Alias for Employee_record#effective_scheduler_link

Returns:

  • (Object)

    Employee_record#effective_scheduler_link

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#email_templatesActiveRecord::Relation<EmailTemplate>

Returns:

See Also:



217
# File 'app/models/employee.rb', line 217

has_many :email_templates, as: :resource, dependent: :destroy, inverse_of: :employee

#employee_accountAccount

Returns:

See Also:



197
# File 'app/models/employee.rb', line 197

has_one  :employee_account, class_name: 'Account', foreign_key: 'party_id', dependent: :destroy, inverse_of: :employee

#employee_eventsActiveRecord::Relation<EmployeeEvent>

Returns:

See Also:



203
# File 'app/models/employee.rb', line 203

has_many :employee_events, dependent: :destroy, inverse_of: :employee

#employee_events_email_settingsActiveRecord::Relation<EmployeeEventsEmailSetting>

Returns:

See Also:



219
# File 'app/models/employee.rb', line 219

has_many :employee_events_email_settings, inverse_of: :employee, dependent: :destroy

#employee_goalsActiveRecord::Relation<EmployeeGoal>

Returns:

See Also:



224
# File 'app/models/employee.rb', line 224

has_many :employee_goals, through: :employee_reviews

#employee_phone_statusEmployeePhoneStatus



199
# File 'app/models/employee.rb', line 199

has_one  :employee_phone_status, dependent: :destroy, inverse_of: :employee

#employee_recordEmployeeRecord

Validations:



198
# File 'app/models/employee.rb', line 198

has_one  :employee_record, foreign_key: :party_id, dependent: :destroy, inverse_of: :party

#employee_reviewsActiveRecord::Relation<EmployeeReview>

Returns:

See Also:



223
# File 'app/models/employee.rb', line 223

has_many :employee_reviews, through: :employee_record

#employee_survey_enrollmentsActiveRecord::Relation<EmployeeSurveyEnrollment>

Returns:

See Also:



229
# File 'app/models/employee.rb', line 229

has_many :employee_survey_enrollments, dependent: :destroy, inverse_of: :employee

#employee_time_offsActiveRecord::Relation<EmployeeTimeOff>

Returns:

See Also:



221
# File 'app/models/employee.rb', line 221

has_many :employee_time_offs, inverse_of: :employee, dependent: :destroy

#employee_topicsActiveRecord::Relation<EmployeeTopic>

Returns:

See Also:



200
# File 'app/models/employee.rb', line 200

has_many :employee_topics, foreign_key: :party_id, dependent: :destroy, inverse_of: :employee

#employee_work_schedulesActiveRecord::Relation<EmployeeWorkSchedule>

Returns:

See Also:



220
# File 'app/models/employee.rb', line 220

has_many :employee_work_schedules, inverse_of: :employee, dependent: :destroy

#has_role?Object

Alias for Account#has_role?

Returns:

  • (Object)

    Account#has_role?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#heatwave_preferencesObject

Alias for Employee_record#heatwave_preferences

Returns:

  • (Object)

    Employee_record#heatwave_preferences

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#hide_signature_call_text_me_directlyObject

Alias for Employee_record#hide_signature_call_text_me_directly

Returns:

  • (Object)

    Employee_record#hide_signature_call_text_me_directly

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#interesting_factObject

Alias for Employee_record#interesting_fact

Returns:

  • (Object)

    Employee_record#interesting_fact

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#is_admin?Object

Alias for Account#is_admin?

Returns:

  • (Object)

    Account#is_admin?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#is_document_maintainer?Object

Alias for Account#is_document_maintainer?

Returns:

  • (Object)

    Account#is_document_maintainer?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#is_local_sales_rep?Object

Alias for Account#is_local_sales_rep?

Returns:

  • (Object)

    Account#is_local_sales_rep?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#is_manager?Object

Alias for Account#is_manager?

Returns:

  • (Object)

    Account#is_manager?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#is_marketing_manager?Object

Alias for Account#is_marketing_manager?

Returns:

  • (Object)

    Account#is_marketing_manager?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#is_sales_manager?Object

Alias for Account#is_sales_manager?

Returns:

  • (Object)

    Account#is_sales_manager?

See Also:



279
280
281
# File 'app/models/employee.rb', line 279

delegate :has_role?, :is_admin?, :is_manager?, :is_sales_manager?,
:is_local_sales_rep?, :is_marketing_manager?,
:is_document_maintainer?, to: :account

#it_assetsActiveRecord::Relation<ItAsset>

Returns:

  • (ActiveRecord::Relation<ItAsset>)

See Also:



218
# File 'app/models/employee.rb', line 218

has_many :it_assets, dependent: :destroy, inverse_of: :employee

#job_descriptionObject

Alias for Employee_record#job_description

Returns:

  • (Object)

    Employee_record#job_description

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#job_titleObject

Alias for Employee_record#job_title

Returns:

  • (Object)

    Employee_record#job_title

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#mailing_addressAddress

Returns:

See Also:



194
# File 'app/models/employee.rb', line 194

belongs_to :mailing_address, class_name: 'Address', optional: true

#managed_employeesActiveRecord::Relation<Employee>

Returns:

See Also:



201
# File 'app/models/employee.rb', line 201

has_many :managed_employees, class_name: 'Employee', foreign_key: 'parent_id', dependent: :nullify, inverse_of: :manager

#managerEmployee

Returns:

See Also:



192
# File 'app/models/employee.rb', line 192

belongs_to :manager, class_name: 'Employee', foreign_key: 'parent_id', optional: true, inverse_of: :managed_employees

#monitor_group_sms_numbersObject

Alias for Employee_record#monitor_group_sms_numbers

Returns:

  • (Object)

    Employee_record#monitor_group_sms_numbers

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#monitor_unlinked_extensionsObject

Alias for Employee_record#monitor_unlinked_extensions

Returns:

  • (Object)

    Employee_record#monitor_unlinked_extensions

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#praisesActiveRecord::Relation<Praise>

Returns:

  • (ActiveRecord::Relation<Praise>)

See Also:



222
# File 'app/models/employee.rb', line 222

has_many :praises, through: :employee_record

Alias for Employee_record#print_node_computer_id

Returns:

  • (Object)

    Employee_record#print_node_computer_id

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#rolesActiveRecord::Relation<Role>

Returns:

  • (ActiveRecord::Relation<Role>)

See Also:



216
# File 'app/models/employee.rb', line 216

has_many :roles, through: :account

#sales_goalsActiveRecord::Relation<SalesGoal>

Returns:

See Also:



214
# File 'app/models/employee.rb', line 214

has_many :sales_goals, dependent: :destroy, inverse_of: :employee

#scheduler_booking_pagesActiveRecord::Relation<SchedulerBookingPage>

Returns:

See Also:



235
# File 'app/models/employee.rb', line 235

has_many :scheduler_booking_pages, through: :scheduler_hosts

#scheduler_bookingsActiveRecord::Relation<SchedulerBooking>

Returns:

See Also:



236
# File 'app/models/employee.rb', line 236

has_many :scheduler_bookings, dependent: :destroy

#scheduler_hostsActiveRecord::Relation<SchedulerHost>

Returns:

See Also:



234
# File 'app/models/employee.rb', line 234

has_many :scheduler_hosts, dependent: :destroy

Alias for Employee_record#scheduler_link_type

Returns:

  • (Object)

    Employee_record#scheduler_link_type

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#scheduler_profileSchedulerProfile



206
# File 'app/models/employee.rb', line 206

has_one :scheduler_profile, dependent: :destroy

#searchesActiveRecord::Relation<Search>

Returns:

  • (ActiveRecord::Relation<Search>)

See Also:



215
# File 'app/models/employee.rb', line 215

has_many :searches, dependent: :destroy, inverse_of: :employee

#selected_menu_optionsObject

Alias for Employee_record#selected_menu_options

Returns:

  • (Object)

    Employee_record#selected_menu_options

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#shipping_addressAddress

Returns:

See Also:



195
# File 'app/models/employee.rb', line 195

belongs_to :shipping_address, class_name: 'Address', optional: true

Alias for Employee_record#show_calendly_link

Returns:

  • (Object)

    Employee_record#show_calendly_link

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#show_signature_photoObject

Alias for Employee_record#show_signature_photo

Returns:

  • (Object)

    Employee_record#show_signature_photo

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#showcasesActiveRecord::Relation<Showcase>

Returns:

See Also:



204
# File 'app/models/employee.rb', line 204

has_many :showcases, dependent: :nullify, inverse_of: :employee

#signature_picture_smallObject

Alias for Employee_record#signature_picture_small

Returns:

  • (Object)

    Employee_record#signature_picture_small

See Also:



282
283
284
285
286
287
# File 'app/models/employee.rb', line 282

delegate :heatwave_preferences, :job_title, :job_description, :interesting_fact,
:certifications, :signature_picture_small, :print_node_computer_id,
:selected_menu_options, :hide_signature_call_text_me_directly,
:show_calendly_link, :calendly_link, :show_signature_photo, :monitor_group_sms_numbers, :monitor_unlinked_extensions,
:scheduler_link_type, :effective_scheduler_link,
to: :employee_record, allow_nil: true

#survey_enrollmentsActiveRecord::Relation<SurveyEnrollment>

Returns:

See Also:



230
# File 'app/models/employee.rb', line 230

has_many :survey_enrollments, through: :employee_survey_enrollments

#technical_support_invoicesActiveRecord::Relation<Invoice>

Returns:

  • (ActiveRecord::Relation<Invoice>)

See Also:



233
# File 'app/models/employee.rb', line 233

has_many :technical_support_invoices, class_name: 'Invoice', foreign_key: 'technical_support_rep_id', dependent: :nullify, inverse_of: :technical_support_rep

#time_off_balancesActiveRecord::Relation<TimeOffBalance>

Returns:

See Also:



209
# File 'app/models/employee.rb', line 209

has_many :time_off_balances, dependent: :destroy, inverse_of: :employee

#time_off_policiesActiveRecord::Relation<TimeOffPolicy>

Returns:

See Also:



210
211
212
# File 'app/models/employee.rb', line 210

has_many :time_off_policies,
-> { select('time_off_policies.*, time_off_policy_assignments.accrual_start_date AS accrual_start_date') },
through: :time_off_policy_assignments

#time_off_policy_assignmentsActiveRecord::Relation<TimeOffPolicyAssignment>

Returns:

See Also:



208
# File 'app/models/employee.rb', line 208

has_many :time_off_policy_assignments, dependent: :destroy, inverse_of: :employee

#time_off_requestsActiveRecord::Relation<TimeOffRequest>

Returns:

See Also:



207
# File 'app/models/employee.rb', line 207

has_many :time_off_requests, dependent: :destroy, inverse_of: :employee

#trainer_contact_training_topicsActiveRecord::Relation<ContactTrainingTopic>

Returns:

See Also:



226
# File 'app/models/employee.rb', line 226

has_many :trainer_contact_training_topics, class_name: 'ContactTrainingTopic', foreign_key: 'trainer_party_id', inverse_of: :trainer_party, dependent: :destroy

#trainer_employee_topicsActiveRecord::Relation<EmployeeTopic>

Returns:

See Also:



225
# File 'app/models/employee.rb', line 225

has_many :trainer_employee_topics, class_name: 'EmployeeTopic', foreign_key: 'trainer_party_id', inverse_of: :trainer_party, dependent: :destroy

#work_schedulesActiveRecord::Relation<WorkSchedule>

Returns:

See Also:



205
# File 'app/models/employee.rb', line 205

has_many :work_schedules, dependent: :destroy, inverse_of: :employee