diff --git a/app/controllers/contestnotifications_controller.rb b/app/controllers/contestnotifications_controller.rb index 574ed389b..5e935ff4d 100644 --- a/app/controllers/contestnotifications_controller.rb +++ b/app/controllers/contestnotifications_controller.rb @@ -65,7 +65,8 @@ class ContestnotificationsController < ApplicationController # GET /contestnotifications/1 # GET /contestnotifications/1.json def show - # @contestnotification = Contestnotification.find(params[:id]) + @contestnotification = Contestnotification.find(params[:id]) + # # respond_to do |format| # format.html # show.html.erb diff --git a/app/models/contestnotification.rb b/app/models/contestnotification.rb index f245e7adc..e9f6c9a67 100644 --- a/app/models/contestnotification.rb +++ b/app/models/contestnotification.rb @@ -2,6 +2,7 @@ class Contestnotification < ActiveRecord::Base #attr_accessible :author_id, :notificationcomments_count, :contest_id, :description, :summary, :title include Redmine::SafeAttributes + #Contestnotification::Notificationcomment belongs_to :contest belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' has_many :notificationcomments, :as => :notificationcommented, :dependent => :delete_all, :order => "created_at" diff --git a/app/models/notificationcomments.rb b/app/models/notificationcomment.rb similarity index 89% rename from app/models/notificationcomments.rb rename to app/models/notificationcomment.rb index 1aad7c7e3..f8eb7020e 100644 --- a/app/models/notificationcomments.rb +++ b/app/models/notificationcomment.rb @@ -1,4 +1,4 @@ -class Notificationcomments < ActiveRecord::Base +class Notificationcomment < ActiveRecord::Base attr_accessible :author_id, :notificationcommented_id, :notificationcommented_type, :notificationcomments include Redmine::SafeAttributes diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb index ec73b9c4c..f333e0a4e 100644 --- a/app/views/contestnotifications/show.html.erb +++ b/app/views/contestnotifications/show.html.erb @@ -1,23 +1,23 @@
- <%= watcher_link(@contestnotifications, User.current) %> + <%= watcher_link(@contestnotification, User.current) %> <%= link_to(l(:button_edit), - edit_contest_contestnotification_path(@contestnotifications), + edit_contest_contestnotification_path(@contestnotification), :class => 'icon icon-edit', :accesskey => accesskey(:edit), :onclick => '$("#edit-contestnotifications").show(); return false;') if User.current.allowed_to?(:manage_contestnotifications, @contest) %> - <%= delete_link contest_contestnotification_path(@contestnotifications) if User.current.allowed_to?(:manage_contestnotifications, @contest) %> + <%= delete_link contest_contestnotification_path(@contestnotification) if User.current.allowed_to?(:manage_contestnotifications, @contest) %>
-

<%=h @contestnotifications.title %>

+

<%=h @contestnotification.title %>

<% if authorize_for_contest('contestnotifications', 'edit') %>