This file contains hidden or 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
| /** | |
| * Reproduction test for the artwork generation polling bug. | |
| * | |
| * Simulates the exact pattern from useArtworkGeneration.tsx: | |
| * 1. Create a query with enabled: false (createdArtwork is undefined → id is NaN) | |
| * 2. Update observer to new query key (simulating setCreatedArtwork triggering re-render) | |
| * 3. Run setInterval calling refetch().then(({ data }) => ...) to poll for generated: true | |
| * | |
| * The mock query function returns generated: false for the first N calls, | |
| * then generated: true — simulating the iris-artwork worker finishing. |
This file contains hidden or 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
| class CreateUserService | |
| def initialize(user_attributes) | |
| @user_attributes = user_attributes | |
| end | |
| def call | |
| puts "Creating user with following attributes.." | |
| p @user_attributes | |
| end | |
| end |
This file contains hidden or 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
| class Rapper < ApplicationRecord | |
| belongs_to :agent, class_name: "User" | |
| has_many :bookings | |
| end | |
| class User < ApplicationRecord | |
| has_many :rappers, foreign_key: :agent_id | |
| has_many :bookings | |
| # source: -> pour spécifier à AR qu'il doit aller chercher la relation bookings du rapper comme source pour les reservations |
This file contains hidden or 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
| module PrivateAttrMethodsDecorators | |
| module Explicit | |
| module ClassMethods | |
| def private_attr_reader(*attributes) | |
| attributes.each do |attr| | |
| attr_reader attr | |
| private attr | |
| end | |
| end |
This file contains hidden or 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
| CyLemeunier |