Skip to content

Commit

Permalink
Check for constant definition before invoking
Browse files Browse the repository at this point in the history
Closes #1913
  • Loading branch information
KaanOzkan committed Jun 17, 2024
1 parent aaf1d32 commit 9ca1b4d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def type_for_activerecord_value(column_type)
"::Money"
when ActiveRecord::Type::Integer
"::Integer"
when ActiveRecord::Encryption::EncryptedAttributeType
when defined?(ActiveRecord::Encryption) && ActiveRecord::Encryption::EncryptedAttributeType
# Reflect to see if `ActiveModel::Type::Value` is being used first.
getter_type = Tapioca::Dsl::Helpers::ActiveModelTypeHelper.type_for(column_type)
return getter_type unless getter_type == "T.untyped"
Expand Down

0 comments on commit 9ca1b4d

Please sign in to comment.