Retrospring/app/models/anonymous_block.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
343 B
Ruby
Raw Normal View History

2022-06-14 15:17:02 -07:00
# frozen_string_literal: true
require "digest"
2022-06-14 08:09:10 -07:00
class AnonymousBlock < ApplicationRecord
belongs_to :user, optional: true
2022-06-14 08:09:10 -07:00
belongs_to :question, optional: true
belongs_to :target_user, class_name: "User", optional: true
def self.get_identifier(ip)
Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip)
end
2022-06-14 08:09:10 -07:00
end