1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/telegram_user.rb

12 lines
342 B
Ruby

# frozen_string_literal: true
class TelegramUser < ApplicationRecord
validates :remote_telegram_id, presence: true
validates :first_name, presence: true
before_validation do
self.last_name = nil if last_name.blank?
self.username = nil if username.blank?
self.language_code = nil if language_code.blank?
end
end