Skip to content

Instantly share code, notes, and snippets.

@jhass
Created November 16, 2011 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhass/1369842 to your computer and use it in GitHub Desktop.
Save jhass/1369842 to your computer and use it in GitHub Desktop.
Add all followers to an aspect, edit and save under script/follow_all.rb, run with bundle exec ruby ./script/follow_all.rb
#!/usr/bin/env ruby
user_id = 0 # your user id
aspect_name = "Work" # Name of the aspect followers should be added to
require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'config', 'environment')
user = User.find(user_id)
aspect = user.aspects.where(:name => aspect_name).first
user.contacts.only_sharing.each do |contact|
begin
user.share_with(contact.person, aspect)
rescue
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment