mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-03 16:51:58 -04:00
Added time stamps to each qbo entity model
This commit is contained in:
@@ -10,11 +10,19 @@
|
||||
|
||||
class Employee < ActiveRecord::Base
|
||||
|
||||
include Redmine::I18n
|
||||
|
||||
has_many :users
|
||||
validates_presence_of :id, :name
|
||||
|
||||
self.primary_key = :id
|
||||
|
||||
# Returns the last sync time formatted for display. If no sync has occurred, returns a default message.
|
||||
def self.last_sync
|
||||
return I18n.t(:label_qbo_never_synced) unless maximum(:updated_at)
|
||||
format_time(maximum(:updated_at))
|
||||
end
|
||||
|
||||
# Sync all employees, typically triggered by a scheduled task or manual sync request
|
||||
def self.sync
|
||||
EmployeeSyncJob.perform_later(full_sync: true)
|
||||
|
||||
Reference in New Issue
Block a user