|
|
@ -31,7 +31,7 @@ class Comment < ActiveRecord::Base
|
|
|
|
:title=>Proc.new {|o| "RE: #{o.commented.title}" },
|
|
|
|
:title=>Proc.new {|o| "RE: #{o.commented.title}" },
|
|
|
|
:url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} }
|
|
|
|
:url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} }
|
|
|
|
|
|
|
|
|
|
|
|
belongs_to :commented, :polymorphic => true, :counter_cache => true
|
|
|
|
belongs_to :commented, :polymorphic => true, :counter_cache => true,:touch => true
|
|
|
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
|
|
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
|
|
|
validates_presence_of :commented, :author, :comments
|
|
|
|
validates_presence_of :commented, :author, :comments
|
|
|
|
safe_attributes 'comments'
|
|
|
|
safe_attributes 'comments'
|
|
|
|