class OnboardingForm
include ActiveModel::Model
include ActiveModel::Attributes
STEPS = %i[account profile preferences].freeze
import { Type } from 'class-transformer';
import { IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
export class CursorPaginationQuery {
@IsOptional()
@IsString()
module Paginatable
extend ActiveSupport::Concern
included do
before_action :set_pagination_params, only: [:index]
end
<?php
namespace App\Feature;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Contracts\Service\ResetInterface;
<?php
use App\Http\Controllers\CommentController;
use Illuminate\Support\Facades\Route;
// The ->scoped() call forces {comment} to resolve through $post->comments,
class ApplicationCommand
Result = Struct.new(:value, :errors) do
def success?
errors.nil? || errors.empty?
end
module DangerousAction
extend ActiveSupport::Concern
FRESH_WINDOW = 10.minutes
class ConfirmationMismatch < StandardError; end
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ProjectPresenter
def initialize(project, include_tasks: true)
@project = project
@include_tasks = include_tasks
end
package com.shop.api.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
class OrderPresenter < SimpleDelegator
attr_reader :current_user
def initialize(order, current_user:)
super(order)
@current_user = current_user