intercom / intercom-rails

The easiest way to install Intercom in a Rails app.
https://developers.intercom.io/reference
MIT License
280 stars 106 forks source link

Allow proc as custom data #157

Closed graemeboyd closed 8 years ago

graemeboyd commented 8 years ago

Custom data can now be a Proc which is called with the user or company at runtime. The Proc must return a hash which will be set as the custom data and sent to Intercom.

Fix for #156

config.user.custom_data = Proc.new { |user| SomeObject.user_custom_attributes(user) }
bobjflong commented 8 years ago

Hi @graemeboyd, it seems like CI is failing, possibly due to the gemspec changes?

Startouf commented 8 years ago

Actually I believe #73 was trying to do the same thing. and Issue #220 for reference. I would love to see this feature that makes using the intercom-rails horrible for a lot of attributes

kant01ne commented 8 years ago

@graemeboyd thanks for contributing. I just merged a PR that's allowing to create custom attributes with Proc (https://github.com/intercom/intercom-rails/pull/225) so I'm closing this one.