comparison app/models/comment.rb @ 931:ec1c49528f36 cannam_integration

Merge from branch "redmine-1.3"
author Chris Cannam
date Wed, 27 Jun 2012 15:04:58 +0100
parents 5f33065ddc4b
children 433d4f72a19b
comparison
equal deleted inserted replaced
930:027cc0f5d4a2 931:ec1c49528f36
14 # You should have received a copy of the GNU General Public License 14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software 15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 class Comment < ActiveRecord::Base 18 class Comment < ActiveRecord::Base
19 include Redmine::SafeAttributes
19 belongs_to :commented, :polymorphic => true, :counter_cache => true 20 belongs_to :commented, :polymorphic => true, :counter_cache => true
20 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' 21 belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
21 22
22 validates_presence_of :commented, :author, :comments 23 validates_presence_of :commented, :author, :comments
24
25 safe_attributes 'comments'
23 end 26 end