Hello Le Wagon 👋
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |