balanv
balanv

Reputation: 10888

Functions to be run only when server is started

I am working on a Rails application. I want to execute a piece of code only during server start-up. Where do I add this code?

Upvotes: 3

Views: 97

Answers (1)

Mischa
Mischa

Reputation: 43298

In config/initializers. All the .rb files in that directory will only be run when the server is started.

Upvotes: 6

Related Questions