Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure replacing has_one associations respects the supplied :dependen…
…t option. [#1305 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
- Loading branch information
Showing
4 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just ran into an issue because of this - not sure how well thought out this was...
@owner.clear_association_cache
will clear out all unsaved associations - which can lead to some really fun to track down mysteries if you happen to replace an association after you just built another association.Unless there is some further, unstated reasoning behind the "screw it, let's just nuke everything"-approach,
@owner.instance_variable_set "@#{@reflection.name}", nil unless @owner.new_record?
, should be used instead.