Module: Invitation::Invitable::InstanceMethods
- Defined in:
- lib/invitation/invitable.rb
Overview
Instance methods for invitables.
Instance Method Summary collapse
-
#add_invited_user(user) ⇒ Object
Add the invited user to the organization.
-
#invitable_name ⇒ Object
Get the name of the organization for use in invitations.
Instance Method Details
#add_invited_user(user) ⇒ Object
Add the invited user to the organization. Called by InvitesController.
40 41 42 43 |
# File 'lib/invitation/invitable.rb', line 40 def add_invited_user(user) method = Invitation.configuration.user_model.name.underscore.pluralize send(method).push(user) end |
#invitable_name ⇒ Object
Get the name of the organization for use in invitations.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/invitation/invitable.rb', line 48 def invitable_name if [:named_by] send([:named_by]) elsif [:named] [:named] else raise 'Invitation runtime error: invitable does not have name: or named_by: set, should not be possible! ' + inspect end end |