Added broadcast to jobs create and update
This commit is contained in:
@@ -11,6 +11,9 @@ class Job < ApplicationRecord
|
||||
before_save :update_paid_at, if: :will_save_change_to_status?
|
||||
before_save :update_status_changed_at, if: :will_save_change_to_status?
|
||||
|
||||
after_create_commit -> { broadcast_prepend_later_to 'jobs', partial: 'jobs/job_tr' }
|
||||
after_update_commit -> { broadcast_replace_later_to 'jobs', partial: 'jobs/job_tr' }
|
||||
|
||||
# NOTE: Multiple status if paing before brinting?
|
||||
enum status: {
|
||||
open: 0,
|
||||
@@ -40,7 +43,7 @@ class Job < ApplicationRecord
|
||||
.or(Job.where(status: %i[paid canceled])
|
||||
.where('status_changed_at >= ?', Time.now.beginning_of_day))
|
||||
# .in_status_order
|
||||
# .order(created_at: :asc)
|
||||
.order(created_at: :desc)
|
||||
.order(:costumer_firstname, :costumer_lastname)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user