Sha256: c77342211f0dcd7d4b2af7f6dd974e72af5e641a260cab120418caa9f971f2b0
Contents?: true
Size: 424 Bytes
Versions: 4
Compression:
Stored size: 424 Bytes
Contents
class LoginActivity < ApplicationRecord belongs_to :user, polymorphic: true, optional: true encrypts :identity, deterministic: true encrypts :ip, deterministic: true before_save :reduce_precision # reduce precision to city level to protect IP def reduce_precision self.latitude = latitude&.round(1) if try(:latitude_changed?) self.longitude = longitude&.round(1) if try(:longitude_changed?) end end
Version data entries
4 entries across 4 versions & 1 rubygems