Sha256: 68514728822be33fb57148f9bc7986709c460b888ca9183f52fcbc70e654e59b

Contents?: true

Size: 445 Bytes

Versions: 6

Compression:

Stored size: 445 Bytes

Contents

module IntercomRails

  module CustomDataHelper
    STORE = Struct.new(:user, :company)

    # This helper allows custom data attributes to be added to a user
    # for the current request from within the controller. e.g.
    #
    # def destroy
    #   intercom_custom_data.user['canceled_at'] = Time.now
    #   ...
    # end
    def intercom_custom_data
      @_request_specific_intercom_custom_data ||= STORE.new({}, {})
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
intercom-rails-1.0.6 lib/intercom-rails/custom_data_helper.rb
intercom-rails-1.0.5 lib/intercom-rails/custom_data_helper.rb
intercom-rails-1.0.4 lib/intercom-rails/custom_data_helper.rb
intercom-rails-1.0.1 lib/intercom-rails/custom_data_helper.rb
intercom-rails-1.0.0 lib/intercom-rails/custom_data_helper.rb
intercom-rails-0.4.2 lib/intercom-rails/custom_data_helper.rb