Sort the users by id

This commit is contained in:
Petko Bordjukov 2014-09-18 01:07:09 +03:00
parent 3d4d9d6e20
commit 24ddcaba3a
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,8 @@ class User < ActiveRecord::Base
accepts_nested_attributes_for :speaker_profile, update_only: true accepts_nested_attributes_for :speaker_profile, update_only: true
default_scope { order id: :desc }
def toggle_admin! def toggle_admin!
update admin: !admin update admin: !admin
end end