Skip to content

Commit

Permalink
Use new index_name_exists? method signature if rails6 too
Browse files Browse the repository at this point in the history
Preparing for Rails 6.
#291

qa gemspec still allows rails 5.0, so we will leave the "else" condition for rails 5.0 there (although rails 5.0 makes the third param optional and may work without it too, if it ain't broke why fix it).
  • Loading branch information
jrochkind committed Nov 21, 2019
1 parent 941dec5 commit 0e61bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/qa/authorities/local/mysql_table_based_authority.rb
Expand Up @@ -21,7 +21,7 @@ def search(q)

def self.index_name_exists?
conn = ActiveRecord::Base.connection
if ActiveRecord::VERSION::MAJOR >= 5 && ActiveRecord::VERSION::MINOR >= 1
if (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR >= 1) || ActiveRecord::VERSION::MAJOR >= 6
conn.index_name_exists?(table_name, table_index).blank?
else
conn.index_name_exists?(table_name, table_index, :default).blank?
Expand Down

0 comments on commit 0e61bc5

Please sign in to comment.