Skip to content

Clarify how intercom-rails resolves the current user - #379

Merged
shab2k03 merged 4 commits into
masterfrom
shab/current-user-resolution
Oct 12, 2026
Merged

shab2k03 merged 4 commits into
masterfrom
shab/current-user-resolution

Conversation

@shab2k03

@shab2k03 shab2k03 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Use current_user as the default source for the Messenger user, and exclude unsaved user and company records from Messenger settings. Update the setup guidance and add coverage for both behaviours.

Behaviour change

The gem no longer reads @user automatically. In some controllers, @user is the record being displayed rather than the signed-in user, so it is not a reliable default. Applications that use @user for the signed-in user can continue to do so by configuring it explicitly:

config.user.current = Proc.new { @user }

Records that report themselves as unsaved are now excluded consistently, whether they expose new_record?, persisted?, or new?. Applications that already provide a saved current_user need no configuration change.

@shab2k03
shab2k03 merged commit 3f139dd into master Oct 12, 2026
4 checks passed
@shab2k03
shab2k03 deleted the shab/current-user-resolution branch October 12, 2026 15:36
@shab2k03 shab2k03 mentioned this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants