`reload` should fully reload attributes #15866

Merged
merged 1 commit into from Jun 22, 2014

Conversation

Projects
None yet
3 participants
@sgrif
Member

sgrif commented Jun 22, 2014

reload is meant to put a record in the same state it would be if you
were to do Post.find(post.id). This means we should fully replace the
attributes hash.

`reload` should fully reload attributes
`reload` is meant to put a record in the same state it would be if you
were to do `Post.find(post.id)`. This means we should fully replace the
attributes hash.

senny added a commit that referenced this pull request Jun 22, 2014

Merge pull request #15866 from sgrif/sg-reload-attributes
`reload` should fully reload attributes

@senny senny merged commit 7035a20 into rails:master Jun 22, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details

@sgrif sgrif deleted the sgrif:sg-reload-attributes branch Jun 22, 2014

senny added a commit that referenced this pull request Jun 22, 2014

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jun 22, 2014

Member

This introduces a slight backwards incompatibility. You were able to access attributes from a custom select after a reload. Those attributes won't change after the reload so I look at this as a bug fix.

It would be nice to issue a deprecation in these cases but I don't think we can easily detect wether someone is accessing these attributes.

/cc @rafaelfranca

Member

senny commented Jun 22, 2014

This introduces a slight backwards incompatibility. You were able to access attributes from a custom select after a reload. Those attributes won't change after the reload so I look at this as a bug fix.

It would be nice to issue a deprecation in these cases but I don't think we can easily detect wether someone is accessing these attributes.

/cc @rafaelfranca

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jun 26, 2014

Member

hmm, not sure about this change. I'd expect the select attributes to be there after the reload.

Member

rafaelfranca commented Jun 26, 2014

hmm, not sure about this change. I'd expect the select attributes to be there after the reload.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jun 26, 2014

Member

but you would also expect, that they were reloaded, no?

Member

senny commented Jun 26, 2014

but you would also expect, that they were reloaded, no?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jun 26, 2014

Member

Ah, yes. If they are not being reloaded so it make sense to remove this behavior.

Member

rafaelfranca commented Jun 26, 2014

Ah, yes. If they are not being reloaded so it make sense to remove this behavior.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jun 26, 2014

Member

@rafaelfranca exactly. Removing them is not perfect but it's better than keeping them around without updating them. This could lead to bad bugs.

Member

senny commented Jun 26, 2014

@rafaelfranca exactly. Removing them is not perfect but it's better than keeping them around without updating them. This could lead to bad bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment