scambra/devise_invitable — Issue #137: invitation_limit
Author: jtadeulopes
Created: 2011-10-26 15:06:12+00:00
State: open

Hi,

When I reset invitation and send invitation again invitation limit is decremented, see this test:

~~~.ruby
it "should not decrement when send invitation again" do
user = create(:user)
user.invitation_limit.should eql(5) # pass

# first invite
invited = User.invite!({:email => "123X@456.com", :username => "123456", :name => "user", :skip_invitation => true}, user)
user.invitation_limit.should eql(4) # pass

# send invitation again
invited = User.invite!({:email => "123X@456.com", :username => "123456", :name => "user", :skip_invitation => true}, user)
user.invitation_limit.should eql(4) # got 3
end
~~~

Why invitation limit is decremented?