Module: Horde::Actions::FollowMethods::ActorMethods

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

Overview

methods for user, usually User class in your app.

Instance Method Summary collapse

Instance Method Details

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

user follow something.



25
26
27
28
29
30
31
32
33
34
# File 'lib/horde/actions/follow.rb', line 25

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

  follow
end