Add an ordering scope to Wiki

This commit is contained in:
Riyad Preukschas 2013-01-11 20:04:14 +01:00
parent 5aada8cc2a
commit 167f26b90d
2 changed files with 10 additions and 8 deletions

View file

@ -25,6 +25,8 @@ class Wiki < ActiveRecord::Base
before_update :set_slug
scope :ordered, order("created_at DESC")
def to_param
slug
end