Skip to content

Commit

Permalink
Merge pull request rails#49452 from Shopify/pg-ensure-type-map-loaded
Browse files Browse the repository at this point in the history
Ensure PG connection is configured before looking up types
  • Loading branch information
byroot authored Oct 2, 2023
2 parents 7c303b9 + 618db13 commit af2b1da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def type_cast(value) # :nodoc:
end

def lookup_cast_type_from_column(column) # :nodoc:
verify! if type_map.nil?
type_map.lookup(column.oid, column.fmod, column.sql_type)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,7 @@ def initialize_type_map(m) # :nodoc:
end

private
def type_map
@type_map ||= Type::HashLookupTypeMap.new
end
attr_reader :type_map

def initialize_type_map(m = type_map)
self.class.initialize_type_map(m)
Expand Down

0 comments on commit af2b1da

Please sign in to comment.