ip addresses: move more logic to Danbooru::IpAddress.

* Move `is_local?` from IpLookup to Danbooru::IpAddress.
* Refactor more things to use Danbooru::IpAddress instead of using
  IPAddress directly.
This commit is contained in:
evazion
2021-03-01 16:35:55 -06:00
parent 35a0c6b11f
commit 92b8f24724
8 changed files with 47 additions and 37 deletions

View File

@@ -3,6 +3,8 @@
# and their browser user agent. This is used to track logins and other events.
class UserSession < ApplicationRecord
attribute :ip_addr, :ip_address
belongs_to :ip_geolocation, foreign_key: :ip_addr, primary_key: :ip_addr, optional: true
def self.visible(user)