Skip to content

Commit

Permalink
Merge pull request #1907 from alex-tan/cidr-support
Browse files Browse the repository at this point in the history
Support Postgres `cidr` column type
  • Loading branch information
KaanOzkan authored May 21, 2024
2 parents 12a8fb7 + e12b986 commit 73327a3
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 73327a3

Please sign in to comment.