Class: ThisData::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/this_data/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_configuration_fileObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/this_data/install_generator.rb', line 7

def create_configuration_file
  initializer "this_data.rb" do
    <<-EOS
ThisData.setup do |config|
  config.api_key = "#{api_key}"

  # user_method will be called on a controller when using TrackRequest
  # config.user_method =        :current_user

  # The following methods will be called on the object returned by user_method,
  # to capture details about the user
  # config.user_id_method =     :id
  # config.user_name_method =   :name
  # config.user_email_method =  :email
  # config.user_mobile_method = :mobile

  # Define a Logger instance if you want to debug / track errors
  # config.logger = Rails.logger unless Rails.env.production?

  # Set this to false if you want ThisData.track to perform in the same thread
  # config.asyc =               false
end
EOS
  end
end