Skip to content

Commit 158cf86

Browse files
committed
add external id (assignable user flag)
1 parent de3dd7f commit 158cf86

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

app/models/user.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ def is_test?
243243
!!is_test
244244
end
245245

246+
def has_external_id?
247+
external_ids.exists?
248+
end
249+
246250
def is_anonymous?
247251
false
248252
end

app/views/layouts/_posthog.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
title_1_school: <%= current_user&.title_1_school || false %>,
3535
country_code: "<%= current_user&.country_code %>",
3636
is_administrator: <%= current_user&.is_administrator || false %>,
37+
has_external_id: <%= current_user&.has_external_id? || false %>,
3738
},
3839
{
3940
uuid: "<%= current_user&.uuid %>",

lib/ox_posthog.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def self.log(user, event, extra_props = {})
4040
country_code: user.country_code,
4141
receive_newsletter: user.receive_newsletter,
4242
is_administrator: user.is_administrator,
43+
has_external_id: user.has_external_id?,
4344
},
4445
'$set_once': {
4546
uuid: user.uuid,

spec/lib/posthog_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,10 @@
7373
is_sheerid_verified: true,
7474
which_books: 'Biology',
7575
how_many_students: '100-200',
76-
title_1_school: false,
77-
grant_tutor_access: true,
7876
country_code: 'US',
7977
receive_newsletter: true,
8078
is_administrator: user.is_administrator,
79+
has_external_id: false,
8180
)
8281
)
8382
)

0 commit comments

Comments
 (0)