mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-18 02:20:37 -05:00
Remove orphaned code
* customers#filter_estimates_by_customer and #filter_invoices_by_customer, their routes, permission entries and template: they filled an estimate dropdown on the old issue form, which is gone. * Routes with no action: accounts new/create/show/edit/update/destroy (only index, Set default and Sync exist) and customers#destroy. * Unused methods: AuthHelper#require_user, #allowed_to?, #check_permission; CustomersController#address_to_s; CustomerToken#expired? and .remove_expired_tokens; QboBaseModel#skip_qbo_push?; QboDraft.writable_document?; SyncServiceBase#extract_value. * CustomersController's before_action helpers are private. * The unused .autocomplete-meta style and 28 unused translation keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
92f9eb1bc7
commit
0d143e6eb1
11 files changed
+38
-161
No files matched your search
@@ -21,16 +21,6 @@ class CustomerToken < ApplicationRecord
|
||||
|
||||
TOKEN_EXPIRATION = 1.month
|
||||
|
||||
# Check if the token has expired
|
||||
def expired?
|
||||
expires_at.present? && expires_at <= Time.current
|
||||
end
|
||||
|
||||
# Remove expired tokens from the database
|
||||
def self.remove_expired_tokens
|
||||
where("expires_at <= ?", Time.current).delete_all
|
||||
end
|
||||
|
||||
# Get or create a token for the given issue
|
||||
def self.get_token(issue)
|
||||
return unless issue
|
||||
|
||||
@@ -79,12 +79,6 @@ class QboBaseModel < ActiveRecord::Base
|
||||
QboSyncJob.perform_later(entity: model_name.name, id: id)
|
||||
end
|
||||
|
||||
# Flag used to update local without pushing to QBO.
|
||||
# This is used to prevent loops with the webhook
|
||||
def skip_qbo_push?
|
||||
!!skip_qbo_push
|
||||
end
|
||||
|
||||
def self.qbo_sync(push: true)
|
||||
self.qbo_push_enabled = push
|
||||
end
|
||||
|
||||
@@ -31,14 +31,6 @@ class QboDraft < ApplicationRecord
|
||||
where(document: documents)
|
||||
}
|
||||
|
||||
def self.writable_document?(document, user = User.current)
|
||||
case document.to_s
|
||||
when 'estimate' then RedmineQboBilling.writer?(user)
|
||||
when 'invoice' then RedmineQboBilling.invoice_writer?(user)
|
||||
else false
|
||||
end
|
||||
end
|
||||
|
||||
# The editor's fields as posted (estimate[...])
|
||||
def fields
|
||||
parsed = JSON.parse(data.presence || '{}')
|
||||
|
||||
Reference in new issue
Block a user