Module: Invitation::Invitable::InstanceMethods

Defined in:
lib/invitation/invitable.rb

Overview

Instance methods for invitables.

Instance Method Summary collapse

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_nameObject

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 invitable_options[:named_by]
    send(invitable_options[:named_by])
  elsif invitable_options[:named]
    invitable_options[:named]
  else
    raise 'Invitation runtime error: invitable does not have name: or named_by: set, should not be possible! ' +
          inspect
  end
end