Open alfmatos opened 7 years ago
After further investigating, it seems that the helper des not work when followed by a redirect. Putting the helper on the index works, as it just render the index view. Putting it on a create/destroy does not, since it renders a redirect.
This works:
def index
intercom_custom_data.user["reports"] = 10
end
This does not:
def create
@report = Report.new
if @report.save
intercom_custom_data.user["reports"] = 5
format.html { redirect_to PATH, notice: 'NOTICE' }
end
end
Hi,
I've setup a project with intercom-ruby and intercom-rails. The ruby part is for events, everything else is intercom-rails. However, custom data attributes using the helper do not show up on the intercom dashboard.
intercom_custom_data.user[:reports] = 5
I've tried using the key as a string "app_activated_at", and several other options, but nothing seems to work. A couple of things:
I didn't define anything relating to custom data on the initializer, since I don't want this sent every time to the server (only on certain operations will do)
I'm using a test app (not sure if there's any impact)
The struct appears to be correctly filled in after calling the helper:
I'm using devise, so the
current_user
is available.The
current_user
does not have any custom_data attributes afaik (not sure if that is expected)But then nothing happens, even though the usual attributes get updated correctly.
Version info
Expected behavior
Expected to use the helper and it would update the remote custom data attributes.
Actual behavior
No attributes get updatedm and no error is raised anywhere
Steps to reproduce