lib/pg_trunk/core/railtie/custom_types.rb
# All custom types are typecasted to strings in Rails
All custom types are typecasted to strings in Rails
All custom types are typecasted to strings in Rails
def enable_pg_trunk_types
      execute(<<~SQL).each { |item| enable_pg_trunk_type(**item.symbolize_keys) }
        SELECT (
          CASE
          WHEN t.typnamespace = 'public'::regnamespace THEN t.typname
          ELSE t.typnamespace::regnamespace || '.' || t.typname
          END
        ) AS name, t.oid
        FROM pg_trunk e JOIN pg_type t ON t.oid = e.oid
        WHERE e.classid = 'pg_type'::regclass
      SQL
    end
def enable_pg_trunk_types execute ( <<~SQL ) . each { | item | enable_pg_trunk_type ( ** item . symbolize_keys ) } 
        SELECT (
          CASE
          WHEN t.typnamespace = 'public'::regnamespace THEN t.typname
          ELSE t.typnamespace::regnamespace || '.' || t.typname
          END
        ) AS name, t.oid
        FROM pg_trunk e JOIN pg_type t ON t.oid = e.oid
        WHERE e.classid = 'pg_type'::regclass
       SQL end
All custom types are typecasted to strings in Rails
All custom types are typecasted to strings in Rails