Skip to content


Subversion checkout URL

You can clone with
Download ZIP


controller instance variables do not get reloaded #6575

andyvb opened this Issue · 7 comments

3 participants


This is an issue with Rails 3.2.4 (works fine in Rails 3.2.3)

1) create a new rails app

rails new rails_3_2_4
cd rails_3_2_4
rails g scaffold foo name:string
rake db:migrate
rails s -e development

2) go to /foos and create a new Foo record
3) go back to /foos

The new Foo records is not listed. If you restart the server, it is now listed. But if you create a new Foo record, it is not listed again until you restart the server.

Expected Result:
The new Foo record should be listed.


Could you provide an example application? This behavior is well tested and I don't think that this is a Rails bug.


Agreed seems crazy. Here is the sample app:


@andyvb I've tried your steps and everything works okay with 3.2.4 on my computer


@pixeltrix seems this is the same issue that #6576.


@andyvb @rafaelfranca it's a duplicate of #6576 - the cached Model.all is not been invalidated.


Snap :smile:


@pixeltrix, @rafaelfranca thanks guys, I thought I was going crazy. Seems pretty serious.

@pixeltrix pixeltrix closed this issue from a commit
@pixeltrix pixeltrix Restore behavior of Active Record 3.2.3 scopes
A series of commits relating to preloading and scopes caused a regression.
Cloning the relation calls initialize_copy which resets a number of instance
variables to nil. Without this the scope thinks that it is already loaded
when it is called again.

Reverts the following commits:

Fixes #6575, #6576 & #6577
@pixeltrix pixeltrix closed this in 7056079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.