class Member < ApplicationRecord
  belongs_to :image, class_name: "WarpEngine::Image", optional: true
  has_one :admin_user

  validates :nick, presence: true, uniqueness: true

  default_scope { where(deleted_at: nil) }

  def self.ransackable_attributes(auth_object = nil)
    %w[avatar_filename created_at deleted_at id image_id motto nick real_nick updated_at]
  end

  def self.ransackable_associations(auth_object = nil)
    %w[image]
  end
end
