Skip to content

Commit f14d0a6

Browse files
Move up primary email to public
1 parent 681c4d4 commit f14d0a6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/workos/directory_user.rb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ def to_json(*)
5252
merge(authorization_attributes)
5353
end
5454

55+
# @deprecated Will be removed in a future major version. Use {#email} instead.
56+
def primary_email
57+
primary_email = (emails || []).find { |email| email[:primary] }
58+
return primary_email[:value] if primary_email
59+
end
60+
5561
private
5662

5763
def base_attributes
@@ -81,13 +87,5 @@ def authorization_attributes
8187
roles: roles,
8288
}
8389
end
84-
85-
public
86-
87-
# @deprecated Will be removed in a future major version. Use {#email} instead.
88-
def primary_email
89-
primary_email = (emails || []).find { |email| email[:primary] }
90-
return primary_email[:value] if primary_email
91-
end
9290
end
9391
end

0 commit comments

Comments
 (0)