Skip to content

Support alignment in config file #287

@hcopperm

Description

@hcopperm

Version info

  • intercom-rails version: latest
  • Rails version: 4.2.10

Expected behavior

Passing in config.alignment in the config file should change the alignment of the widget.

Actual behavior

The Rails app won't start, because 'alignment' is not a supported config option.

Steps to reproduce

  1. Add config.alignment = 'left' to your intercom-rails config file
  2. Start app

Logs

/Users/amitree/workspace/amitree/config/initializers/intercom_rails.rb:8:in `block in <top (required)>': undefined
method `alignment=' for IntercomRails::Config:Class (NoMethodError)

Notes

You can get around this error by putting alignment in config.user.custom_data

  config.user.custom_data = {
    'alignment' => Proc.new { |_current_user| 'left' },
  ...
  }

This is undocumented and not obvious, and also it is unclear if it will have unknown side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions