Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set support requires a bit of baby-sitting...
Browse files Browse the repository at this point in the history
jamis committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a3e295b commit 7aebf02
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mongoid/fields/foreign_key.rb
Original file line number Diff line number Diff line change
@@ -134,6 +134,8 @@ def resizable?
# @return [ Object ] The converted object.
def mongoize_foreign_key(object)
if type == Array || type == Set
object = object.to_a if type == Set || object.is_a?(Set)

if object.resizable?
object.blank? ? object : association.convert_to_foreign_key(object)
else

0 comments on commit 7aebf02

Please sign in to comment.