diff options
| author | mo k <mo@mokhan.ca> | 2013-01-20 20:55:34 -0700 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2013-01-20 20:55:34 -0700 |
| commit | 38ca4c58ebb665c9ab6a0b38f30d457a076eaf9a (patch) | |
| tree | 2326e89490128a853baa11c5f3574ad635d31a40 /app/models/tutorial.rb | |
| parent | a47f64059e42e5328dc9ba7d2d1db9f603f776c3 (diff) | |
show newest tutorials first.
Diffstat (limited to 'app/models/tutorial.rb')
| -rw-r--r-- | app/models/tutorial.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/tutorial.rb b/app/models/tutorial.rb index 2a45676a..a74f40e0 100644 --- a/app/models/tutorial.rb +++ b/app/models/tutorial.rb @@ -3,6 +3,8 @@ class Tutorial < ActiveRecord::Base belongs_to :user acts_as_taggable + default_scope order("created_at DESC") + def to_param "#{id}-#{heading.gsub(/[^a-z0-9]+/i, '-')}" end |
