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

Preserve existing attachment assignment behavior for upgraded apps #36716

Merged
merged 1 commit into from Jul 20, 2019

Conversation

@georgeclaghorn
Copy link
Member

commented Jul 19, 2019

Assigning a collection of attachments appends to the collection as it did in 5.2. Existing 5.2 apps that rely on this behavior will no longer break when they're upgraded to 6.0.

For apps generated on 6.0 or newer, assigning replaces the existing attachments in the collection. #attach should be used to add new attachments to the collection without removing existing ones.

I expect that we'll deprecate the old behavior in 6.1.

Closes #36374.

To-do:

  • Tests
  • Changelog and documentation updates
  • Review

@georgeclaghorn georgeclaghorn force-pushed the ast-assignment-backcompat branch 3 times, most recently from 5321642 to 1cd1477 Jul 19, 2019

@rails-bot rails-bot bot added the docs label Jul 19, 2019

@georgeclaghorn georgeclaghorn force-pushed the ast-assignment-backcompat branch from 1cd1477 to bb67f60 Jul 19, 2019

@georgeclaghorn georgeclaghorn force-pushed the ast-assignment-backcompat branch 2 times, most recently from 8d239c3 to ce31f2d Jul 20, 2019

Preserve existing attachment assignment behavior for upgraded apps
Assigning to a collection of attachments appends rather than replacing, as in 5.2. Existing 5.2 apps that rely on this behavior will no longer break when they're upgraded to 6.0.

For apps generated on 6.0 or newer, assigning replaces the existing attachments in the collection. #attach should be used to add new attachments to the collection without removing existing ones.

I expect that we'll deprecate the old behavior in 6.1.

Closes #36374.

@georgeclaghorn georgeclaghorn force-pushed the ast-assignment-backcompat branch from ce31f2d to 5d1adb7 Jul 20, 2019

@georgeclaghorn georgeclaghorn merged commit 400b210 into master Jul 20, 2019

2 checks passed

buildkite/rails Build #62332 passed (6 minutes, 10 seconds)
Details
codeclimate All good!
Details

@georgeclaghorn georgeclaghorn deleted the ast-assignment-backcompat branch Jul 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.