use set ID like we do with the other entities

This commit is contained in:
2026-03-08 15:04:31 -04:00
parent 60fb4e197c
commit 88b452b889
3 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -11,7 +11,6 @@
class CreateItems < ActiveRecord::Migration[7.0]
def change
create_table :items do |t|
t.integer :qbo_id, null: false
t.text :description, null: false
t.decimal :unit_price,
precision: 15,