mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:29:52 +01:00
13 lines
343 B
Ruby
13 lines
343 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "digest"
|
|
|
|
class AnonymousBlock < ApplicationRecord
|
|
belongs_to :user, optional: true
|
|
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
|
|
end
|