Database configuration

18 views
Skip to first unread message

Steve Brownlee

unread,
Jun 9, 2014, 5:55:53 PM6/9/14
to vanit...@googlegroups.com
Hey everyone, just learning the ropes of Vanity to do some A/B testing on the Lonely Planet site.

In the documentation there's a short example showing the configuration file

development:
  adapter: mongodb
  database: analytics
test:
  collecting: false
production:
  adapter: mongodb
  database: analytics

Two questions:
1.  How to I let Vanity know which environment the app is running in so that it pulls the correct configuration?
2.  What is the "test" key for?  I found no explanation for that in the docs.


Thanks so much in advance for any guidance.

h.ad...@icloud.com

unread,
Jun 10, 2014, 9:02:36 AM6/10/14
to vanit...@googlegroups.com

Two questions:
1.  How to I let Vanity know which environment the app is running in so that it pulls the correct configuration?

This link might be more helpful: http://vanity.labnotes.org/configuring.html but basically it's the same as the environment of the app in which you're using Vanity. So if you're running in a Rails app, the environment matches your Rails env, which is development by default. If you're unsure about what a Rails environment is then look into the Rails documentation (for example, http://guides.rubyonrails.org/configuring.html#rails-environment-settings ). If it's a Rack app rather than Rails then I think it's much the same but you use the RACK_ENV variable rather than RAILS_ENV.

2.  What is the "test" key for?  I found no explanation for that in the docs.

It's for when your app is in test env, such as running your unit tests (so test here refers to code tests and NOT A/B tests).

Hope that helps,

Henry
 
Reply all
Reply to author
Forward
0 new messages