Skip to content

Commit

Permalink
improve explanation for invitation_limit, closes #256
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Dec 21, 2012
1 parent 5de5f6a commit d3ed2b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Expand Up @@ -88,7 +88,7 @@ or directly as parameters to the <tt>devise</tt> method:

devise :database_authenticatable, :confirmable, :invitable, :invite_for => 2.weeks

* invitation_limit: The number of invitations users can send. The default value of nil means users can send as many invites as they want. A setting of 0 means they can't send invitations. A setting n > 0 means they can send n invitations.
* invitation_limit: The number of invitations users can send. The default value of nil means users can send as many invites as they want, there is no limit for any user, invitation_limit column is not used. A setting of 0 means they can't send invitations. A setting n > 0 means they can send n invitations. You can change invitation_limit column for some users so they can send more or less invitations, even with global invitation_limit = 0.

* invite_key: The key to be used to check existing users when sending an invitation. You can use multiple keys. This value must be a hash with the invite key as hash keys, and regexp to validate format as values. If you don't want to validate the key you can set nil as validation format. The default value is looking for users by email and validating with Devise.email_regexp {:email => Devise.email_regexp}.

Expand Down
9 changes: 6 additions & 3 deletions lib/generators/devise_invitable/install_generator.rb
Expand Up @@ -25,9 +25,12 @@ def add_config_options_to_initializer
# config.invite_for = 2.weeks
# Number of invitations users can send.
# If invitation_limit is nil, users can send unlimited invitations.
# If invitation_limit is 0, users can't send invitations.
# If invitation_limit n > 0, users can send n invitations.
# - If invitation_limit is nil, there is no limit for invitations, users can
# send unlimited invitations, invitation_limit column is not used.
# - If invitation_limit is 0, users can't send invitations by default.
# - If invitation_limit n > 0, users can send n invitations.
# You can change invitation_limit column for some users so they can send more
# or less invitations, even with global invitation_limit = 0
# Default: nil
# config.invitation_limit = 5
Expand Down

0 comments on commit d3ed2b2

Please sign in to comment.