Module: DeviseInvitable::Inviter
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise_invitable/inviter.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#has_invitations_left? ⇒ Boolean
Return true if this user has invitations left to send.
- #invitation_limit ⇒ Object
Instance Method Details
#has_invitations_left? ⇒ Boolean
Return true if this user has invitations left to send
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/devise_invitable/inviter.rb', line 15 def has_invitations_left? if self.class.invitation_limit.present? if invitation_limit return invitation_limit > 0 else return self.class.invitation_limit > 0 end else return true end end |
#invitation_limit ⇒ Object
10 11 12 |
# File 'lib/devise_invitable/inviter.rb', line 10 def invitation_limit self[:invitation_limit] || self.class.invitation_limit end |