Class: AdditionalCallCredit
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- AdditionalCallCredit
- Includes:
- Models::Auditable
- Defined in:
- app/models/additional_call_credit.rb
Overview
== Schema Information
Table name: additional_call_credits
Database name: primary
id :integer not null, primary key
additional_credits :float not null
credits_date :date
notes :string(1000)
created_at :datetime not null
updated_at :datetime not null
creator_id :integer
employee_id :integer not null
updater_id :integer
Indexes
index_additional_call_credits_on_credits_date (credits_date)
index_additional_call_credits_on_employee_id (employee_id)
Constant Summary
Constants included from Models::Auditable
Models::Auditable::ALWAYS_IGNORED
Instance Attribute Summary collapse
- #additional_credits ⇒ Object readonly
- #credits_date ⇒ Object readonly
- #employee_id ⇒ Object readonly
Class Method Summary collapse
-
.active ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are active.
-
.sorted ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are sorted.
-
.with_employee_name ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are with employee name.
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::EventPublishable
Instance Attribute Details
#additional_credits ⇒ Object (readonly)
32 |
# File 'app/models/additional_call_credit.rb', line 32 validates :employee_id, :additional_credits, :credits_date, presence: true |
#credits_date ⇒ Object (readonly)
32 |
# File 'app/models/additional_call_credit.rb', line 32 validates :employee_id, :additional_credits, :credits_date, presence: true |
#employee_id ⇒ Object (readonly)
32 |
# File 'app/models/additional_call_credit.rb', line 32 validates :employee_id, :additional_credits, :credits_date, presence: true |
Class Method Details
.active ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are active. Active Record Scope
25 |
# File 'app/models/additional_call_credit.rb', line 25 scope :active, -> { where(employee_id: Employee.active) } |
.sorted ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are sorted. Active Record Scope
24 |
# File 'app/models/additional_call_credit.rb', line 24 scope :sorted, -> { order(credits_date: :desc) } |
.with_employee_name ⇒ ActiveRecord::Relation<AdditionalCallCredit>
A relation of AdditionalCallCredits that are with employee name. Active Record Scope
26 |
# File 'app/models/additional_call_credit.rb', line 26 scope :with_employee_name, -> { select('additional_call_credits.*,(select full_name from parties where id = employee_id) as employee_name') } |