Files
postter/app/models/user.rb
João Victor Geonizeli 7a24f7950b add limit of post per day
2022-02-27 17:10:15 -03:00

13 lines
278 B
Ruby

class User < ApplicationRecord
validates :username,
presence: true,
uniqueness: true,
length: { maximum: 14 },
allow_nil: false,
format: {
with: /\A[a-zA-Z0-9]+\z/,
}
has_many :posts
end