mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-15 18:39:58 +01:00
added User#comment
This commit is contained in:
parent
641fa1ddc3
commit
d6111d6835
1 changed files with 10 additions and 0 deletions
|
@ -100,4 +100,14 @@ class User < ActiveRecord::Base
|
|||
rescue NoMethodError
|
||||
website
|
||||
end
|
||||
|
||||
def comment(answer, content)
|
||||
Comment.create(user: self, answer: answer, content: content)
|
||||
increment! :commented_count
|
||||
answer.increment! :comment_count
|
||||
end
|
||||
|
||||
def destroy_comment(comment)
|
||||
# TODO: implement this
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue