Module: Horde::Actions::CommentMethods::ActorMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/horde/actions/comment.rb

Overview

methods for user, usually User class in your app.

Instance Method Summary collapse

Instance Method Details

#comment(target, options = {}) ⇒ Object

user comment something.



27
28
29
30
31
32
33
34
35
36
# File 'lib/horde/actions/comment.rb', line 27

def comment(target, options = {})
  params = {:actor_id => self.id, 
            :target_id => target.id,
            :target_type => target.class.name
           }.merge(options)
  comment = ::Horde::Comment.create(params)
  target.run_hook(:after_comment, comment)

  comment
end