CustomerToken.purge_expired deletes share links that have expired or
whose issue was deleted. It runs whenever a new link is made, so they
don't pile up, and from rake redmine_qbo:purge_customer_tokens for a
manual or scheduled run. Expired links were only ignored before.
Also drops Issue's belongs_to :customer_token: issues have no such
column, so the association could only raise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* 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>
When QBO plugin is not configured, OAUTH_CONSUMER_SECRET can be
nil, and any codepath hitting the model raises a stack trace.
Set a "safe-ish" value here to allow execution in conditions where
QBO plugin is installed, but not yet configured.