Use #data_source_exists? instead of #table_exists?
DEPRECATION WARNING: #table_exists? currently checks both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only check tables. Use #data_source_exists? instead.
This commit is contained in:
@@ -12,7 +12,7 @@ Devise.setup do |config|
|
||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||
# note that it will be overwritten if you use your own mailer class
|
||||
# with default "from" parameter.
|
||||
if Rails.env.test? || !ActiveRecord::Base.connection.table_exists?("settings")
|
||||
if Rails.env.test? || !ActiveRecord::Base.connection.data_source_exists?("settings")
|
||||
config.mailer_sender = "noreply@consul.dev"
|
||||
else
|
||||
config.mailer_sender = "'#{Setting["mailer_from_name"]}' <#{Setting["mailer_from_address"]}>"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class CreateVerifiedUsers < ActiveRecord::Migration
|
||||
def change
|
||||
unless ActiveRecord::Base.connection.table_exists? 'verified_users'
|
||||
unless ActiveRecord::Base.connection.data_source_exists?("verified_users")
|
||||
create_table :verified_users do |t|
|
||||
t.string :document_number
|
||||
t.string :document_type
|
||||
|
||||
Reference in New Issue
Block a user