Skip to content

Commit

Permalink
Revert "Skip uuidable when uuidable called before schema loaded (#14)"
Browse files Browse the repository at this point in the history
This reverts commit 6cd17da.
  • Loading branch information
EeGGik committed Apr 17, 2024
1 parent 3b659db commit fe2b49b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/uuidable/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe2b49b

Please sign in to comment.