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 f78aa3a45..270757cc5 100644 --- a/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb +++ b/lib/tapioca/dsl/helpers/active_record_column_type_helper.rb @@ -196,6 +196,16 @@ def type_for_activerecord_value(column_type, column_nullability:) ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array === type } "T::Array[#{type_for_activerecord_value(column_type.subtype, column_nullability:)}]" + when ->(type) { + defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit) && + ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit === type + } + "::String" + when ->(type) { + defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::BitVarying) && + ActiveRecord::ConnectionAdapters::PostgreSQL::OID::BitVarying === type + } + "::String" when ->(type) { defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Range) && ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Range === type diff --git a/sorbet/rbi/shims/activerecord_postgresql.rbi b/sorbet/rbi/shims/activerecord_postgresql.rbi index d7ab45e4f..427f09b51 100644 --- a/sorbet/rbi/shims/activerecord_postgresql.rbi +++ b/sorbet/rbi/shims/activerecord_postgresql.rbi @@ -7,3 +7,5 @@ module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore; end module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr; end module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Interval; end module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Range; end +module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit; end +module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::BitVarying; end