Change Relation#all to Relation#load [ci skip] #12904

Merged
merged 1 commit into from Nov 16, 2013

Conversation

Projects
None yet
3 participants
@sbagdat
Contributor

sbagdat commented Nov 15, 2013

Using all method with a Relation object is deprecated, so I changed it to load method. Original message from rails console:

DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, 
you can call #load (e.g.`Post.where(published: true).load`). If you want to get an array of 
records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`).
@egilburg

This comment has been minimized.

Show comment Hide comment
@egilburg

egilburg Nov 16, 2013

Contributor

I remember a while ago Rails saying I should change SomeModel.scoped to SomeModel.all if I want a non-eager-loaded normal scope I can pass around. If .all is now deprecated too, what is the replacement to former .scoped/.all?

Contributor

egilburg commented Nov 16, 2013

I remember a while ago Rails saying I should change SomeModel.scoped to SomeModel.all if I want a non-eager-loaded normal scope I can pass around. If .all is now deprecated too, what is the replacement to former .scoped/.all?

@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Nov 16, 2013

Member

@egilburg SomeModel.all is not deprecated. SomeModel.where(something: true).all is.

Member

rafaelfranca commented Nov 16, 2013

@egilburg SomeModel.all is not deprecated. SomeModel.where(something: true).all is.

rafaelfranca added a commit that referenced this pull request Nov 16, 2013

Merge pull request #12904 from sbagdat/patch-1
Change Relation#all to Relation#load [ci skip]

@rafaelfranca rafaelfranca merged commit 66f1681 into rails:master Nov 16, 2013

rafaelfranca added a commit that referenced this pull request Nov 16, 2013

Merge pull request #12904 from sbagdat/patch-1
Change Relation#all to Relation#load [ci skip]

@sbagdat sbagdat deleted the sbagdat:patch-1 branch Nov 16, 2013

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