diff --git a/app/models/contestnotification.rb b/app/models/contestnotification.rb index b983778e4..a055d3000 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 658d7d894..c9ce1622d 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) %>