Skip to content

Commit

Permalink
Support Postgres cidr column type
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tan committed May 21, 2024
1 parent 12a8fb7 commit e12b986
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 @@ -101,6 +101,9 @@ def type_for_activerecord_value(column_type)
when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid) &&
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid
"::String"
when defined?(ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr) &&
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr
"::IPAddr"
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
Expand Up @@ -4,3 +4,4 @@
module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid; end
module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array; end
module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Hstore; end
module ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Cidr; end

0 comments on commit e12b986

Please sign in to comment.