diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-09-28 13:36:06 -0400 |
---|---|---|
committer | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-09-28 14:24:36 -0400 |
commit | 4775d3d051af1a506b63a7e4069c94e49c82177d (patch) | |
tree | bd4dfbe583b86ee24e2548b83cc50f323891a918 /activerecord/lib/active_record/database_configurations | |
parent | 7d89337b1722587961b9bb81031661b99935d919 (diff) | |
download | rails-4775d3d051af1a506b63a7e4069c94e49c82177d.tar.gz rails-4775d3d051af1a506b63a7e4069c94e49c82177d.tar.bz2 rails-4775d3d051af1a506b63a7e4069c94e49c82177d.zip |
Refactor migrations_path command option to database
Diffstat (limited to 'activerecord/lib/active_record/database_configurations')
3 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/database_configurations/database_config.rb b/activerecord/lib/active_record/database_configurations/database_config.rb index 6250827b34..adc37cc439 100644 --- a/activerecord/lib/active_record/database_configurations/database_config.rb +++ b/activerecord/lib/active_record/database_configurations/database_config.rb @@ -17,6 +17,10 @@ module ActiveRecord raise NotImplementedError end + def migrations_paths + raise NotImplementedError + end + def url_config? false end diff --git a/activerecord/lib/active_record/database_configurations/hash_config.rb b/activerecord/lib/active_record/database_configurations/hash_config.rb index 13ffe566cf..c176a62458 100644 --- a/activerecord/lib/active_record/database_configurations/hash_config.rb +++ b/activerecord/lib/active_record/database_configurations/hash_config.rb @@ -38,6 +38,13 @@ module ActiveRecord def replica? config["replica"] end + + # The migrations paths for a database configuration. If the + # `migrations_paths` key is present in the config, `migrations_paths` + # will return its value. + def migrations_paths + config["migrations_paths"] + end end end end diff --git a/activerecord/lib/active_record/database_configurations/url_config.rb b/activerecord/lib/active_record/database_configurations/url_config.rb index f526c59d56..81917fc4c1 100644 --- a/activerecord/lib/active_record/database_configurations/url_config.rb +++ b/activerecord/lib/active_record/database_configurations/url_config.rb @@ -48,6 +48,13 @@ module ActiveRecord config["replica"] end + # The migrations paths for a database configuration. If the + # `migrations_paths` key is present in the config, `migrations_paths` + # will return its value. + def migrations_paths + config["migrations_paths"] + end + private def build_config(original_config, url) if /^jdbc:/.match?(url) |