Skip to content

Commit

Permalink
IdentityCache needs column type option as nilable for backcompat
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
  • Loading branch information
paracycle and Morriar committed May 2, 2024
1 parent 975d4f2 commit aa324a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tapioca/dsl/compilers/identity_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def create_index_fetch_by_methods(field, klass)
).void
end
def create_aliased_fetch_by_methods(field, klass)
type, _ = Helpers::ActiveRecordColumnTypeHelper.new(constant).type_for(field.alias_name.to_s)
type, _ = Helpers::ActiveRecordColumnTypeHelper.new(
constant,
column_type_option: Helpers::ActiveRecordColumnTypeHelper::ColumnTypeOption::Nilable,
).type_for(field.alias_name.to_s)
multi_type = type.delete_prefix("T.nilable(").delete_suffix(")").delete_prefix("::")
suffix = field.send(:fetch_method_suffix)

Expand Down

0 comments on commit aa324a6

Please sign in to comment.