class ReindexCheckpoint < ApplicationRecord
enum status: { idle: 0, running: 1, done: 2, failed: 3 }
validates :index_name, presence: true, uniqueness: true
def self.for(index_name)
import { onCLS, onINP, onLCP, onFCP, onTTFB, type Metric } from 'web-vitals';
export interface VitalPayload {
id: string;
name: Metric['name'];
value: number;
import DataLoader from "dataloader";
import { Pool } from "pg";
export interface User { id: number; name: string; }
export interface Post { id: number; user_id: number; title: string; }
class Order < ApplicationRecord
belongs_to :customer
scope :for_export, -> {
select(:id, :reference, :total_cents, :currency, :created_at, :customer_id)
.where.not(exported_at: nil)
class Post < ApplicationRecord
has_many :comments, dependent: :destroy
# comments_count is maintained by counter_cache on Comment#belongs_to
scope :stale_comment_counts, lambda {
from typing import List, Optional
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from .dataloader import DataLoader
import { Writable } from "node:stream";
import type { Pool } from "pg";
interface Row {
email: string;
name: string;
import time
import threading
from dataclasses import dataclass, field
from typing import Callable, Dict, List
class AddSoftDeleteToDocuments < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_column :documents, :marked_for_deletion_at, :datetime, null: true
export interface AnalyticsEvent {
name: string;
props?: Record<string, unknown>;
ts: number;
}
module Notifications
class RecipientSerializer < ActiveJob::Serializers::ObjectSerializer
def serialize?(argument)
argument.is_a?(Notifications::Recipient)
end
class Cart < ApplicationRecord
has_many :cart_items, dependent: :destroy
EXPIRY_WINDOW = 2.hours
scope :active, -> { where(state: :active) }