I want to run the method when starting the rails server. This is a model method.
I tried using config / initializers / myfile.rb, but this method was called during the migration, so it was selected from a nonexistent table.
I also tried environment.rb, but the class does not exist yet (and will probably have the same problem with migrations)
I do not know where to place this method, so it will only start when the server starts, and not during the migration.
Alistra
source share