mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-02 07:01:59 -04:00
use set ID like we do with the other entities
This commit is contained in:
@@ -11,9 +11,10 @@
|
||||
class Item < ApplicationRecord
|
||||
belongs_to :issue
|
||||
|
||||
validates :description, presence: true
|
||||
validates_presence_of :id, :description
|
||||
validates :unit_price, numericality: { greater_than_or_equal_to: 0 }
|
||||
|
||||
self.primary_key = :id
|
||||
|
||||
# Sync all employees, typically triggered by a scheduled task or manual sync request
|
||||
def self.sync
|
||||
ItemSyncJob.perform_later(full_sync: true)
|
||||
|
||||
@@ -24,7 +24,7 @@ class ItemSyncService < SyncServiceBase
|
||||
|
||||
# Map relevant attributes from the QBO Employee to the local Employee model
|
||||
def process_attributes(local, remote)
|
||||
local.qbo_id = remote.id
|
||||
local.id = remote.id
|
||||
local.description = remote.description
|
||||
local.unit_price = remote.unit_price
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user