Files
x-stake/app/models/user_document.rb
2021-08-04 21:53:58 -03:00

31 lines
633 B
Ruby

# frozen_string_literal: true
# == Schema Information
#
# Table name: user_documents
#
# id :bigint not null, primary key
# status :string not null
# created_at :datetime not null
# updated_at :datetime not null
# user_id :bigint not null
#
# Indexes
#
# index_user_documents_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (user_id => users.id)
#
class UserDocument < ApplicationRecord
extend Enumerize
belongs_to :user
has_one_attached :image
enumerize :status,
in: [:pending_review, :approved, :refused],
default: :pending_review
end