github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

mvanholstyn / strac

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 24
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Tree: a24dbfd

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (2)
    • strac-0.1.5
    • 0.1.5
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

agile project management — Read more

  cancel

http://mutuallyhuman.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Sending invitations is working again. 
zdennis (author)
Wed Aug 13 14:17:57 -0700 2008
commit  a24dbfdbc9a1b4c4e0918dede945a647a38ac133
tree    fdb47d8097019f69f7b08ba5f25a6e0c77960333
parent  0948f2c63578b3fb694cc39a1fc53e3f58ccf52e
strac / app / managers / invitation_manager.rb app/managers/invitation_manager.rb
100644 37 lines (30 sloc) 1.125 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'singleton'
 
class InvitationManager
  include Singleton
 
  def self.create_for(project, inviter, recipients, message)
    recipients.split(/\s*,\s*/).map do |recipient|
      Invitation.create!(:project => project, :inviter => inviter, :recipient => recipient,
                         :code => UniqueCodeGenerator.generate(recipient),
                         :message => message)
    end
  end
 
  
  def self.accept_pending_invitations(session, user)
    instance.accept_pending_invitations(session, user)
  end
  
  def self.store_pending_invitation_acceptance(session, code)
    instance.store_pending_invitation_acceptance(session, code)
  end
  
  def accept_pending_invitations(session, user)
    pending_invite_code = session[:pending_invite_code]
    if pending_invite_code
      session[:pending_invite_code] = nil
      invitation = Invitation.find_by_code(pending_invite_code)
      project = Project.find(invitation.project_id)
      user.projects << project
      project.name
    end
  end
  
  def store_pending_invitation_acceptance(session, code)
    session[:pending_invite_code] = code
  end
end
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server