diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-02-13 01:35:20 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 01:35:20 -0300 |
commit | e0d0dc6ec1ea9f690f2f354381c0ddf1c3c2ab0b (patch) | |
tree | 93e036d4454a9f8b96a73560250ac8bec57cff14 /activerecord/lib/active_record/connection_adapters/postgresql | |
parent | 2f60a7525e8727f6c6d111637221b22898179fc5 (diff) | |
parent | 28dc6d76ab302340e98fad7f8718c440e5b1e2d8 (diff) | |
download | rails-e0d0dc6ec1ea9f690f2f354381c0ddf1c3c2ab0b.tar.gz rails-e0d0dc6ec1ea9f690f2f354381c0ddf1c3c2ab0b.tar.bz2 rails-e0d0dc6ec1ea9f690f2f354381c0ddf1c3c2ab0b.zip |
Merge pull request #26930 from kamipo/index_name_exists_default
The `default` arg of `index_name_exists?` makes to optional
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index a4b1723fc7..eebc688686 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -132,7 +132,12 @@ module ActiveRecord end # Verifies existence of an index with a given name. - def index_name_exists?(table_name, index_name, default) + def index_name_exists?(table_name, index_name, default = nil) + unless default.nil? + ActiveSupport::Deprecation.warn(<<-MSG.squish) + Passing default to #index_name_exists? is deprecated without replacement. + MSG + end table = Utils.extract_schema_qualified_name(table_name.to_s) index = Utils.extract_schema_qualified_name(index_name.to_s) |