Skip to content

Commit

Permalink
Merge pull request #1694 from pedrol3001/main
Browse files Browse the repository at this point in the history
Add postgres Uuid to be translated as String by tapioca dsl
  • Loading branch information
vinistock authored Oct 18, 2023
2 parents 20d77ba + 22de174 commit d2a27bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/tapioca/dsl/helpers/active_record_column_type_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down
1 change: 1 addition & 0 deletions sorbet/rbi/shims/activerecord_postgresql.rbi
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d2a27bd

Please sign in to comment.