From 24ddcaba3aeb6fb52e99a294fcd89fdef9f048f3 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 18 Sep 2014 01:07:09 +0300 Subject: [PATCH] Sort the users by id --- app/models/user.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index a44047b..b910966 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -10,6 +10,8 @@ class User < ActiveRecord::Base accepts_nested_attributes_for :speaker_profile, update_only: true + default_scope { order id: :desc } + def toggle_admin! update admin: !admin end