Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload through_record that has been destroyed in create_through_record #27838

Merged
merged 1 commit into from
Jan 31, 2017

Commits on Jan 29, 2017

  1. Reload through_record that has been destroyed in `create_through_re…

    …cord`
    
    This is an alternative of rails#27714.
    
    If `has_one :through` association has set `nil`, `through_record` is
    destroyed but still remain loaded target in `through_proxy` until
    `reload` or `reset` explicitly.
    
    If `through_proxy` is not reset (remain destroyed (frozen) target),
    setting new record causes `RuntimeError: Can't modify frozen hash`.
    
    To prevent `RuntimeError`, should reload `through_record` that has been
    destroyed in `create_through_record`.
    kamipo committed Jan 29, 2017
    Configuration menu
    Copy the full SHA
    e09da8b View commit details
    Browse the repository at this point in the history