17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/arborist_chat_rails/install_generator.rb', line 17
def create_initializer
initializer %q{arborist.rb}, <<~FILE
Rails.application.configure do
# specifies which product in arborist to connect
# the rails application to
config.arborist.app_id = '#{options.dig(APP_ID)}'
config.arborist.app_secret = '#{options.dig(APP_SECRET)}'
# identifies a user. by default this is limited to anomous
# identification (note: this uses cookies so notify users
# appropriately). the current_user lambda will be executed
# in the current controllers context so all methods in the
# controller will be available
config.arborist.current_user = lambda do
{ id: session[:arborist_id] ||= SecureRandom.uuid }
end
end
FILE
end
|