user4689269
user4689269

Reputation:

Rails default_scope prevents my rails app from starting

I have a user model and i want to define a default_scope for ordering like so:

default_scope(order(:firstname))

Nonetheless this is preventing my rails server from starting, any help is appreciated.

Upvotes: 2

Views: 25

Answers (1)

Marek Lipka
Marek Lipka

Reputation: 51191

You should define your scopes with blocks:

default_scope { order(:firstname) }

Upvotes: 2

Related Questions