Class: CommissionStructure

Inherits:
ApplicationRecord show all
Includes:
Models::Auditable
Defined in:
app/models/commission_structure.rb

Overview

== Schema Information

Table name: commission_structures
Database name: primary

id :integer not null, primary key
currency :string(255)
description :string(255)
goal_month_flat :decimal(6, 2)
goal_quarter_tier1_percentage :decimal(8, 4)
goal_quarter_tier2_percentage :decimal(8, 4)
created_at :datetime
updated_at :datetime

Constant Summary

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Constants included from Models::Schedulable

Models::Schedulable::SIMPLE_FORM_OPTIONS

Has many collapse

Class Method Summary collapse

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #creator, #should_not_save_version, #stamp_record, #updater

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.select_optionsArray<Array<String, Integer>>

Returns description and id pairs for select helpers.

Returns:

  • (Array<Array<String, Integer>>)

    description and id pairs for select helpers



39
40
41
# File 'app/models/commission_structure.rb', line 39

def select_options
  all.map { |cs| [cs.description, cs.id] }
end

Instance Method Details

#commission_structure_entriesActiveRecord::Relation<CommissionStructureEntry>

Returns:



35
# File 'app/models/commission_structure.rb', line 35

has_many :commission_structure_entries