From 9c9b0e730cce4f35e4478bb8dd80de66238ce456 Mon Sep 17 00:00:00 2001 From: Pedro Luis Date: Mon, 16 Oct 2023 18:18:39 -0300 Subject: [PATCH 1/2] Add postgres Uuid to be translated as String --- lib/tapioca/dsl/helpers/active_record_column_type_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb b/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb index 89b6dda48..bb9d9a579 100644 --- a/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb +++ b/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb @@ -85,6 +85,9 @@ def type_for_activerecord_value(column_type) "::String" when ActiveRecord::Type::Serialized serialized_column_type(column_type) + when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid) && + ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid + "::String" when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore) && ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore "T::Hash[::String, ::String]" From 22de17491e0652ef7fd894cca55d29259a392831 Mon Sep 17 00:00:00 2001 From: Pedro Luis Date: Mon, 16 Oct 2023 18:32:12 -0300 Subject: [PATCH 2/2] Add postgress uuid constant --- sorbet/rbi/shims/activerecord_postgresql.rbi | 1 + 1 file changed, 1 insertion(+) diff --git a/sorbet/rbi/shims/activerecord_postgresql.rbi b/sorbet/rbi/shims/activerecord_postgresql.rbi index cf32e2fa0..aeff80110 100644 --- a/sorbet/rbi/shims/activerecord_postgresql.rbi +++ b/sorbet/rbi/shims/activerecord_postgresql.rbi @@ -1,5 +1,6 @@ # typed: strict # These constants are dynamically loaded only when connecting to postgresql +module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid; end module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array; end module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore; end