Module: Horde::Actions::RateMethods::ActorMethods

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

Overview

methods for user, usually User class in your app.

Instance Method Summary collapse

Instance Method Details

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

user rate something.



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

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

  rate
end