Class: Audiences::Context
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Audiences::Context
- Includes:
- Locating
- 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
Instance Method Summary collapse
Methods included from Locating
Instance Method Details
#as_json ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'app/models/audiences/context.rb', line 38 def as_json(...) { match_all: match_all, count: count, extra_users: extra_users.instance_exec(&Audiences.default_users_scope), criteria: criteria, }.as_json(...) end |
#users ⇒ Object
32 33 34 |
# File 'app/models/audiences/context.rb', line 32 def users matching_external_users.instance_exec(&Audiences.default_users_scope) end |