Skip to content

Instantly share code, notes, and snippets.

# 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...