Last active
April 12, 2025 09:04
-
-
Save pmatsinopoulos/20dbde10b987886c0d5edfb43b8ace4a to your computer and use it in GitHub Desktop.
UserBalance model for the blog post on Singleton 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 UserBalance < ApplicationRecord | |
belongs_to :user, inverse_of: :user_balance | |
validates :user_id, uniqueness: true | |
validates :balance, numericality: { greater_than_or_equal_to: 0 } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment