Skip to content
Browse files

Tweak article ordering

  • Loading branch information...
1 parent 15dfc65 commit 985d482a439e43c7b3c9c755eda57d9e1fea9db1 @practicingruby practicingruby committed
Showing with 2 additions and 4 deletions.
  1. +1 −1 app/controllers/home_controller.rb
  2. +0 −2 app/models/article.rb
  3. +1 −1 app/views/articles/index.haml
View
2 app/controllers/home_controller.rb
@@ -7,7 +7,7 @@ def index
return redirect_to articles_path
end
- @recent_topics = Article.published.order("created_at DESC").limit(5)
+ @recent_topics = Article.published.order("published_time DESC").limit(5)
render :index, :layout => "landing"
end
View
2 app/models/article.rb
@@ -5,8 +5,6 @@ class Article < ActiveRecord::Base
validates_presence_of :issue_number
- default_scope { order(:created_at) }
-
def self.in_volume(number)
includes(:volume)
.where("volumes.number = ?", number)
View
2 app/views/articles/index.haml
@@ -10,7 +10,7 @@
%p.left= group.description
%ul.index
- -group.articles.published.each do |a|
+ -group.articles.published.order("published_time").each do |a|
%li= link_to a.full_subject, article_path(a)
- if current_user.admin?

0 comments on commit 985d482

Please sign in to comment.
Something went wrong with that request. Please try again.