-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
In https://github.com/mongodb/mongoid/pull/4556, it was requested that Mongoid provides a way for model instances that were loaded using a runtime-altered persistence context to retain that persistence context so that they would be saved to their correct source.
Current behavior when loading and saving using runtime-overridden persistence context:
band = Band.with(collection: 'foo') { |cls| cls.first } # #with must be called again: Band.with(collection: 'foo') { band.save! }
Desired behavior:
band = Band.with(collection: 'foo') { |cls| cls.first } # saves to 'foo' band.save!
- related to
-
MONGOID-4629 Non-block form of persistence context #with
- Backlog
-
MONGOID-5138 Assign persistence context to Mongoid::Criteria
- Backlog