mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Log flights offline: the form is kept by the service worker, flights queue on the device (IndexedDB) and send when back online; one-time keys prevent duplicates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08ba017c7e
commit
191eb030e8
14 files changed
+314
-14
No files matched your search
@@ -0,0 +1,8 @@
|
||||
class AddClientKeyToFlightLogs < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
# A random key from the form, so a flight logged offline and sent again
|
||||
# (after a dropped connection) isn't saved twice.
|
||||
add_column :flight_logs, :client_key, :string
|
||||
add_index :flight_logs, [ :aircraft_id, :client_key ], unique: true
|
||||
end
|
||||
end
|
||||
Generated
+3
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_11_11_040000) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_11_11_050000) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -471,6 +471,8 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_11_040000) do
|
||||
t.text "notes"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "client_key"
|
||||
t.index ["aircraft_id", "client_key"], name: "index_flight_logs_on_aircraft_id_and_client_key", unique: true
|
||||
t.index ["aircraft_id"], name: "index_flight_logs_on_aircraft_id"
|
||||
t.index ["user_id"], name: "index_flight_logs_on_user_id"
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user