aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael França <rafael@franca.dev>2019-07-25 10:19:04 -0400
committerGitHub <noreply@github.com>2019-07-25 10:19:04 -0400
commit4ee88df6a01eadd8abbb07f2c17821a9512f51d0 (patch)
tree1a2a1c6255650485ca3b5513f47cac316930d813 /activerecord/lib
parent3ecaf0aafa43ff6fd511c6557592591ee5731244 (diff)
parentec0dc76c06a0b7afadab7ca5629a8d6a2f3d6370 (diff)
downloadrails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.tar.gz
rails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.tar.bz2
rails-4ee88df6a01eadd8abbb07f2c17821a9512f51d0.zip
Merge pull request #36740 from stanhu/sh-fix-index-exists-postgresql-partial-index
Fix index_exists? for PostgreSQL expression indexes
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 13f94a4722..88367c79a1 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -100,7 +100,7 @@ module ActiveRecord
def index_exists?(table_name, column_name, options = {})
column_names = Array(column_name).map(&:to_s)
checks = []
- checks << lambda { |i| i.columns == column_names }
+ checks << lambda { |i| Array(i.columns) == column_names }
checks << lambda { |i| i.unique } if options[:unique]
checks << lambda { |i| i.name == options[:name].to_s } if options[:name]