diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index c2e31579a4..71772529d2 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -94,6 +94,11 @@ module ActiveRecord end end + initializer "active_record.add_watchable_files" do |app| + files = ["#{app.root}/db/schema.rb", "#{app.root}/db/structure.sql"] + config.watchable_files.concat files.select { |f| File.exist?(f) } + end + config.after_initialize do ActiveSupport.on_load(:active_record) do instantiate_observers |