Class: Activity

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/activity.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.created_by(user) ⇒ Object



23
24
25
# File 'lib/activity.rb', line 23

def self.created_by(user)
  raise "Activity.created_by(user) has been deprecated. Use Activity.by_user(user) instead."
end

.report(user, action, object = nil) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/activity.rb', line 35

def self.report(user, action, object=nil)
  returning Activity.new do |a|
    a.item = object if object
    a.action = action.to_s
    a.user = user
    a.save!
  end
end

.without_model_created_by(user) ⇒ Object



27
28
29
# File 'lib/activity.rb', line 27

def self.without_model_created_by(user)
  raise "Activity.without_model_created_by(user) has been deprecated. Use Activity.by_user(user) and filter the results instead."
end

Instance Method Details

#without_model?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/activity.rb', line 31

def without_model?
  item.nil?
end