module G5Updatable class Location < ActiveRecord::Base include G5Updatable::FirstClassProperties include G5Updatable::UrnAsParameter include BelongsToClient validates :uid, :urn, :client_uid, presence: true scope :by_client_uid, -> (client_uid) { where(client_uid: client_uid) } scope :by_urn, -> (urn) { where(urn: urn) } scope :max_updated_at, -> { maximum(:updated_at) } delegate :urn, to: :client, prefix: true, allow_nil: true end end