Sha256: 9192a0b5e909c498fda5ce4adbc058fe0ec104ed95638d7dfe9196eedf479c5c
Contents?: true
Size: 369 Bytes
Versions: 5
Compression:
Stored size: 369 Bytes
Contents
class NicknameAccessCard < ApplicationRecord belongs_to :user_card before_validation :normalize validates :value, presence: true, uniqueness: true, format: {with: /\A([a-zA-Z][\w]{0,14})\z/i}, :allow_blank => false def normalize self.value.downcase! end # after_destroy :check_active def check_active self.user_card.set_active_card end end
Version data entries
5 entries across 5 versions & 1 rubygems