Add an ordering scope to Wiki
This commit is contained in:
parent
5aada8cc2a
commit
167f26b90d
2 changed files with 10 additions and 8 deletions
|
@ -25,6 +25,8 @@ class Wiki < ActiveRecord::Base
|
|||
|
||||
before_update :set_slug
|
||||
|
||||
scope :ordered, order("created_at DESC")
|
||||
|
||||
def to_param
|
||||
slug
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue