Skip to content

Commit 682134b

Browse files
committed
chore : Add Module autoload path in config & Add db:drop init command in init_app when env development
PostgreSQL 환경이기 때문에 migrate가 필요할 경우, drop-create-migrate 순으로 실행될 수 있도록 했습니다.
1 parent 30eeb4a commit 682134b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

config/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Application < Rails::Application
1515
# not contain `.rb` files, or that should not be reloaded or eager loaded.
1616
# Common ones are `templates`, `generators`, or `middleware`, for example.
1717
config.autoload_lib(ignore: %w[assets tasks])
18+
config.autoload_paths += %W(#{config.root}/app/controllers/code)
1819

1920
# Configuration for the application, engines, and railties goes here.
2021
#

config/initializers/init_app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Rails.application.config.after_initialize do
55
Rails.application.load_tasks
66
unless ActiveRecord::Base.connection.data_source_exists?("schema_migrations")
7+
Rake::Task["db:drop"].invoke
78
Rake::Task["db:create"].invoke
89
Rake::Task["db:migrate"].invoke
910
end

0 commit comments

Comments
 (0)