We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 23c04a2 + 6d764da commit 98c0348Copy full SHA for 98c0348
app/models/devise_token_auth/concerns/user.rb
@@ -95,7 +95,15 @@ module ClassMethods
95
96
97
def tokens_has_json_column_type?
98
- table_exists? && self.columns_hash['tokens'] && self.columns_hash['tokens'].type.in?([:json, :jsonb])
+ database_exists? && table_exists? && self.columns_hash['tokens'] && self.columns_hash['tokens'].type.in?([:json, :jsonb])
99
+ end
100
+
101
+ def database_exists?
102
+ ActiveRecord::Base.connection
103
+ rescue ActiveRecord::NoDatabaseError
104
+ false
105
+ else
106
+ true
107
end
108
109
0 commit comments