Skip to content

Commit

Permalink
Mod: 空评论无法再提交
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Apr 2, 2011
1 parent 91e984f commit 994e476
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class Comment
belongs_to :commentable, :polymorphic => true
belongs_to :user

validates_presence_of :body

before_create :fix_commentable_id
def fix_commentable_id
if self.commentable_id.class == "".class
Expand Down

0 comments on commit 994e476

Please sign in to comment.