From 2e11d76652d8ce007fb46f07801c35d30731483d Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 4 Jun 2014 21:26:57 +0800 Subject: [PATCH] lin --- app/models/contestnotification.rb | 2 +- app/views/contestnotifications/index.html.erb | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/models/contestnotification.rb b/app/models/contestnotification.rb index b983778e..a055d300 100644 --- a/app/models/contestnotification.rb +++ b/app/models/contestnotification.rb @@ -46,7 +46,7 @@ class Contestnotification < ActiveRecord::Base # returns latest news for contests visible by user def self.latest(user = User.current, count = 5) - visible(user).includes([:author, :contest]).order("#{Contestnotifications.table_name}.created_on DESC").limit(count).all + visible(user).includes([:author, :contest]).order("#{Contestnotifications.table_name}.created_at DESC").limit(count).all end private diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb index 658d7d89..c9ce1622 100644 --- a/app/views/contestnotifications/index.html.erb +++ b/app/views/contestnotifications/index.html.erb @@ -1,12 +1,11 @@ - <%= l(:label_news) %> <%= link_to(l(:label_news_new), - new_contest_contestnotification_path(@contest), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %> + new_contest_contestnotification_path(@contest), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %> <% if @contest && User.current.allowed_to?(:manage_contestnotifications, @contest) %>