Class: Audiences::Context

Inherits:
ApplicationRecord show all
Includes:
Locating, MembershipGroup
Defined in:
app/models/audiences/context.rb,
app/models/audiences/context/locating.rb

Overview

Represents a context where the group of users (audience) is relevant. It includes the current matching users and the criteria to match these users (#criteria, #match_all, #extra_users).

Defined Under Namespace

Modules: Locating

Constant Summary

Constants included from Locating

Locating::SIGNED_GID_RESOURCE

Instance Method Summary collapse

Methods included from Locating

#signed_key

Instance Method Details

#refresh_users!Object



22
23
24
25
26
# File 'app/models/audiences/context.rb', line 22

def refresh_users!
  criteria.each(&:refresh_users!)
  update!(users: ContextUsers.new(self).to_a)
  Notifications.publish(self)
end