intercom/intercom-rails — pull request #73 by paracycle (2014-03-03 10:15:08+00:00)
Title: Add ability to supply Proc/Symbol for custom_data

It is sometimes the case that different `custom_data` attribute values are
related to each other and for better performance should be fetched
together. However, the current way of supplying a `Hash` with `Proc`/`Symbol`
values prevents these types of optimizations.

The current patch enables library users to supply a `Proc` or a `Symbol`,
that returns a `Hash`, for the whole `custom_data` attribute. This way, all
`custom_data` that belongs to a single user can be generated in one `Proc`
call. Even better, `custom_data` generation can be turned into a
method on the `User` model if a `Symbol` is supplied.

**Note:** Added tests to ensure new functionality works as intended. I'd be more than happy to add any other tests that you see appropriate.