From fe2b49b67c6615c96a229fd48af5d6b00f31ba56 Mon Sep 17 00:00:00 2001 From: EeGGik <37070153+EeGGik@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:34:56 +0800 Subject: [PATCH] Revert "Skip uuidable when uuidable called before schema loaded (#14)" This reverts commit 6cd17da2517a96d29965273bd3a98b6108ac94cc. --- lib/uuidable/active_record.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/uuidable/active_record.rb b/lib/uuidable/active_record.rb index 05718aa..e5685f0 100644 --- a/lib/uuidable/active_record.rb +++ b/lib/uuidable/active_record.rb @@ -24,8 +24,7 @@ module ClassMethods def uuidable(as_param: true) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity # Configure all uuid columns for MySQL. Database may not be connected (i.e. on assets precompile), so we must supress errors. conn_config = respond_to?(:connection_db_config) ? connection_db_config.configuration_hash : connection_config - - if conn_config[:adapter].include?('mysql') && schema_loaded? + if conn_config[:adapter].include?('mysql') begin columns.select { |c| c.type == :binary && c.limit == 16 && c.name.include?('uuid') }.each do |column| attribute column.name.to_sym, MySQLBinUUID::Type.new