Skip to content

Instantly share code, notes, and snippets.

@jacortinas
Created June 18, 2013 18:36
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 jacortinas/5808043 to your computer and use it in GitHub Desktop.
Save jacortinas/5808043 to your computer and use it in GitHub Desktop.
class User
def follow_default_users
default_user_emails = ['vulume@vulume.com']
default_user_emails.each do |email|
follow_with_email!(email)
end
end
def follow_with_email!(email)
user = User.find_by_email(email)
follow!(user) if user
end
end
@jacortinas
Copy link
Author

Usage:

user = # persisted User model
user.follow_default_users
user.do_something_else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment