Skip to content

Instantly share code, notes, and snippets.

# syntax=docker/dockerfile:1.7-labs
ARG RUBY_VERSION
ARG DISTRO_NAME=bullseye
FROM ruby:$RUBY_VERSION-slim-$DISTRO_NAME AS base
SHELL ["/bin/bash", "-c"]
RUN echo "IRB.conf[:HISTORY_FILE] = ENV['IRB_HISTFILE']" >> ~/.irbrc
# app/controllers/subscriptions/application_controller.rb
class Subscriptions::ApplicationController < ApplicationController
def steps_provider
# current_step est défini dans chaque controller
@steps_provider ||= StepsProvider.new(@subscription, current_step)
end
helper_method(:steps_provider)
def subscription_steps
# app/controllers/events/registrations_controller.rb
class Events::RegistrationsController < ApplicationController
def create
@event = Event.subscribing.find(params[:event_id])
@event.with_lock do
sleep 0.25 # simule un travail plus complexe
@ticket = Ticket.create!(
validated_at: Time.zone.now,
@Melrt
Melrt / SETUP_DAY.md
Created February 23, 2021 17:12
Starting my coding journey...