Files
simple-aircraft-manager-rails/app/models/app_revision.rb
T
rickyandClaude Opus 5.5 8c8e3b7374 Versions: year.month.release (VERSION) plus build (commit); What's new from CHANGELOG.md
Shown on Admin -> About, in the software history, records package, procedures
and sam:doctor; release notes in the app under Help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:03:31 -05:00

20 lines
713 B
Ruby

# Which software versions have run, and when (AC 120-78B 3.2.6): recorded
# when the app starts and by the nightly check.
class AppRevision < ApplicationRecord
scope :latest_first, -> { order(first_seen_at: :desc) }
def self.touch_current!
revision = SystemInfo.new.revision
return if revision.blank? || revision == "unknown"
now = Time.current
record = find_or_initialize_by(revision: revision)
record.first_seen_at ||= now
record.built_at ||= SystemInfo.new.built_at
record.version ||= SystemInfo.new.version
record.last_seen_at = now
record.save!
rescue ActiveRecord::ActiveRecordError => e
Rails.logger.warn("[app revisions] #{e.class}: #{e.message}")
end
end