Skip to content

Commit

Permalink
Replace ConnectionAdapter#table_exists? with cached ActiveRecord::Bas…
Browse files Browse the repository at this point in the history
…e::table_exists? (#979)
  • Loading branch information
cmcinnes-mdsol authored Jun 14, 2023
1 parent 0be1b05 commit b4fdcbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions app/models/good_job/base_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ def coalesce_scheduled_at_created_at
end

def discrete_support?
if connection.table_exists?(GoodJob::DiscreteExecution.table_name)
true
else
migration_pending_warning!
false
end
DiscreteExecution.migrated?
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/good_job/base_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.migration_pending_warning!
# Can be overriden by child class.
# @return [Boolean]
def self.migrated?
return true if connection.table_exists?(table_name)
return true if table_exists?

migration_pending_warning!
false
Expand Down

0 comments on commit b4fdcbb

Please sign in to comment.