Retrospring/app/models/anonymous_block.rb

13 lines
281 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
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