diff --git a/Gemfile.lock b/Gemfile.lock index 24449909b..6efc361eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,8 +127,8 @@ GEM specs: action_text-trix (2.1.16) railties - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) autotuner (1.1.0) aws-eventstream (1.4.0) @@ -337,7 +337,7 @@ GEM psych (5.3.1) date stringio - public_suffix (6.0.2) + public_suffix (7.0.2) puma (7.2.0) nio4r (~> 2.0) raabro (1.4.0) diff --git a/Gemfile.saas b/Gemfile.saas index 913dad385..175b50347 100644 --- a/Gemfile.saas +++ b/Gemfile.saas @@ -12,7 +12,7 @@ gem "console1984", bc: "console1984" gem "audits1984", bc: "audits1984", branch: "flavorjones/coworker-api" # Native push notifications (iOS/Android) -gem "action_push_native", github: "rails/action_push_native" +gem "action_push_native", github: "rails/action_push_native", branch: "add-abstract-record" # Telemetry gem "rails_structured_logging", bc: "rails-structured-logging" diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 0a56a7f67..b93c672a7 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -62,7 +62,8 @@ GIT GIT remote: https://github.com/rails/action_push_native.git - revision: 9fb4a2bfe54270b1a3508028f00aaa586e257655 + revision: 8ef7023a335e1f09ad1fe22a4b7b007b040528bd + branch: add-abstract-record specs: action_push_native (0.3.0) activejob (>= 8.0) diff --git a/db/schema.rb b/db/schema.rb index 19ee667a3..20cb0d161 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -69,19 +69,6 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do t.index ["external_account_id"], name: "index_accounts_on_external_account_id", unique: true end - create_table "action_push_native_devices", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| - t.datetime "created_at", null: false - t.string "name" - t.uuid "owner_id" - t.string "owner_type" - t.string "platform", null: false - t.uuid "session_id" - t.string "token", null: false - t.datetime "updated_at", null: false - t.index ["owner_type", "owner_id", "token"], name: "idx_on_owner_type_owner_id_token_95a4008c64", unique: true - t.index ["session_id"], name: "index_action_push_native_devices_on_session_id" - end - create_table "action_text_rich_texts", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.uuid "account_id", null: false t.text "body", size: :long diff --git a/db/schema_sqlite.rb b/db/schema_sqlite.rb index ab087f4b2..c8ce19e07 100644 --- a/db/schema_sqlite.rb +++ b/db/schema_sqlite.rb @@ -69,19 +69,6 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do t.index ["external_account_id"], name: "index_accounts_on_external_account_id", unique: true end - create_table "action_push_native_devices", force: :cascade do |t| - t.datetime "created_at", null: false - t.string "name", limit: 255 - t.integer "owner_id" - t.string "owner_type", limit: 255 - t.string "platform", limit: 255, null: false - t.string "token", limit: 255, null: false - t.datetime "updated_at", null: false - t.string "uuid", limit: 255, null: false - t.index ["owner_type", "owner_id", "uuid"], name: "idx_on_owner_type_owner_id_uuid_a42e3920d5", unique: true - t.index ["owner_type", "owner_id"], name: "index_action_push_native_devices_on_owner" - end - create_table "action_text_rich_texts", id: :uuid, force: :cascade do |t| t.uuid "account_id", null: false t.text "body", limit: 4294967295 diff --git a/db/migrate/20260114203313_create_action_push_native_devices.rb b/saas/db/migrate/20260114203313_create_action_push_native_devices.rb similarity index 100% rename from db/migrate/20260114203313_create_action_push_native_devices.rb rename to saas/db/migrate/20260114203313_create_action_push_native_devices.rb diff --git a/saas/db/saas_schema.rb b/saas/db/saas_schema.rb index 980e952ac..debc08b19 100644 --- a/saas/db/saas_schema.rb +++ b/saas/db/saas_schema.rb @@ -53,6 +53,19 @@ ActiveRecord::Schema[8.2].define(version: 2026_01_26_230838) do t.index ["token_digest"], name: "index_audits1984_auditor_tokens_on_token_digest", unique: true end + create_table "action_push_native_devices", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| + t.datetime "created_at", null: false + t.string "name" + t.uuid "owner_id" + t.string "owner_type" + t.string "platform", null: false + t.uuid "session_id" + t.string "token", null: false + t.datetime "updated_at", null: false + t.index ["owner_type", "owner_id", "token"], name: "idx_on_owner_type_owner_id_token_95a4008c64", unique: true + t.index ["session_id"], name: "index_action_push_native_devices_on_session_id" + end + create_table "audits1984_audits", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.uuid "auditor_id", null: false t.datetime "created_at", null: false diff --git a/saas/lib/fizzy/saas/engine.rb b/saas/lib/fizzy/saas/engine.rb index b733d7a41..b90113544 100644 --- a/saas/lib/fizzy/saas/engine.rb +++ b/saas/lib/fizzy/saas/engine.rb @@ -10,6 +10,11 @@ module Fizzy # moved from config/initializers/queenbee.rb Queenbee.host_app = Fizzy + # Configure ActionPushNative to use the saas database + ActiveSupport.on_load(:action_push_native_record) do + connects_to database: { writing: :saas, reading: :saas } + end + initializer "fizzy_saas.content_security_policy", before: :load_config_initializers do |app| app.config.x.content_security_policy.form_action = "https://checkout.stripe.com https://billing.stripe.com" end diff --git a/saas/test/fixtures/action_push_native/devices.yml b/saas/test/fixtures/application_push_devices.yml similarity index 100% rename from saas/test/fixtures/action_push_native/devices.yml rename to saas/test/fixtures/application_push_devices.yml