We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Michael Hartl (author)
Fri May 02 12:31:07 -0700 2008
commit  1f7f3ac00736f40234050672b95122dbf52aaad5
tree    2d22ab9dd8620fe4b6a65a8d53fc613f6c037742
parent  d6690c5caae7b1ec575b924c4b2e55f36e9e5dbf
insoshi / lib / activity_logger.rb
100644 14 lines (14 sloc) 0.475 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module ActivityLogger
  def add_activities(options = {})
    person = options[:person]
    include_person = options[:include_person]
    activity = options[:activity] ||
               Activity.create!(:item => options[:item], :person => person)
    person.contacts.each do |c|
      c.activities << activity unless c.activities.include?(activity)
    end
    if include_person
      person.activities << activity unless person.activities.include?(activity)
    end
  end
end