mongodb/mongoid · error · ArgumentError
The :fallback option for association '#{name}' on #{@owner_c
Error message
The :fallback option for association '#{name}' on #{@owner_class} cannot be combined with :autobuild. What it means
Error "The :fallback option for association '#{name}' on #{@owner_class} cannot be combined with :autobuild." thrown in mongodb/mongoid.
Source
Thrown at lib/mongoid/association/relatable.rb:433
Association::Depending.define_dependency!(self)
end
def validate!
@options.keys.each do |opt|
unless self.class::VALID_OPTIONS.include?(opt)
raise Errors::InvalidRelationOption.new(@owner_class, name, opt, self.class::VALID_OPTIONS)
end
end
if @options.key?(:fallback)
unless @options[:fallback].respond_to?(:call)
raise ArgumentError,
"The :fallback option for association '#{name}' on " \
"#{@owner_class} must be a Proc or lambda."
end
if @options.key?(:autobuild)
raise ArgumentError,
"The :fallback option for association '#{name}' on " \
"#{@owner_class} cannot be combined with :autobuild."
end
end
[ name, :"#{name}?", :"#{name}=" ].each do |n|
raise Errors::InvalidRelation.new(@owner_class, n) if Mongoid.destructive_fields.include?(n)
end
end
def polymorph!
return unless polymorphic?
@owner_class.polymorphic = true
end
def create_extension!(&block)
return unless blockView on GitHub (pinned to 0da0e23d71)
When it happens
Trigger: Thrown at lib/mongoid/association/relatable.rb:433 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of mongodb/mongoid@0da0e23d71 (2026-08-23).
Data as JSON: /api/errors/2c96037c423275b1.
Report an issue: GitHub.