Created
April 12, 2025 09:02
-
-
Save pmatsinopoulos/7a0df745fde6fe8b2b367faaadbd26a5 to your computer and use it in GitHub Desktop.
User model for Thread-and-Process-safe Sidekiq Job
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 User < ApplicationRecord | |
has_one :user_balance, dependent: :destroy | |
validates :email, presence: true, uniqueness: { case_sensitive: false } | |
after_create :create_user_balance | |
private | |
def create_user_balance | |
create_user_balance!(balance: 0.0) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment