Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does intercom-rails support for rails engine? #280

Open
dieuyunchang opened this issue Mar 21, 2018 · 0 comments
Open

Does intercom-rails support for rails engine? #280

dieuyunchang opened this issue Mar 21, 2018 · 0 comments

Comments

@dieuyunchang
Copy link

dieuyunchang commented Mar 21, 2018

Hi guys, thank you for building the great app. I got the problem with intercom when I am using engine app.

Version info

  • intercom-rails version: 0.3.5
  • Rails version: 5.1.4

Expected behavior

  • Intercom should load the correct user inside engine app and root app.

Actual behavior

  • Intercom got the latest user signed in on 2 apps. ( 2 sessions (one for root app, one for engine app) are in the same browser).

Steps to reproduce

  1. Root app is using Intercom ( added config intercom.rb file)
config.user.custom_data = {
    :company_admin => Proc.new { |user| user.company_admin? },
}
  1. Add new engine app inside named "ABC"
  2. I create new config file intercom.rb in root_app/engines/config/initializers/intercom.rb and update
config.user.current = Proc.new { current_abc_user } #current_abc_user model class is ABC::User
config.user.custom_data = {
    :admin => Proc.new { |user| user.admin? },
}
  1. The engine app raise error with user.company_admin? (because that user object model hasn't defined the method company_admin?)

Thank you. 🙇

@keloe keloe added invalid and removed invalid labels Jul 5, 2018
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

No branches or pull requests

2 participants