initial sofurry impl

This commit is contained in:
Dylan Knutson
2025-01-29 06:06:46 +00:00
parent b3c33958e6
commit ca5649a28f
31 changed files with 5711 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ Rails.application.configure do
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
"Cache-Control" => "public, max-age=#{1.hour.to_i}",
}
# Show full error reports and disable caching.

View File

@@ -6,13 +6,14 @@ class ActiveRecord::Migration
params(
table_name: T.any(String, Symbol),
column_name: T.any(String, Symbol),
column_type: T.any(String, Symbol),
options: T::Hash[Symbol, T.untyped],
).void
end
def add_json_index(table_name, column_name, options = {})
def add_json_index(table_name, column_name, column_type, options = {})
add_index(
table_name,
"(json_attributes->>'#{column_name}')",
"((json_attributes->>'#{column_name}')::#{column_type})",
name: "idx_#{table_name}_on_#{column_name}",
**options,
)