app/models/concerns/rails_jwt_auth/invitable.rb
def invite!(attributes={})
        attrs = ActiveSupport::HashWithIndifferentAccess.new(attributes.to_h)
        auth_field = RailsJwtAuth.auth_field_name!
        auth_attribute = attrs.delete(auth_field)

        raise ArgumentError unless auth_attribute

        record = RailsJwtAuth.model.find_or_initialize_by(auth_field => auth_attribute)
        record.assign_attributes(attrs)

        record.invite!
        record
      end
# Creates an user and sends an invitation to him.
# If the user is already invited and pending of completing registration
# the invitation is resent by email.
# If the user is already registered, it returns the user with a
# <tt>:taken</tt> on the email field.
#
# @param [Hash] attributes Hash containing user's attributes to be filled.
#               Must contain an email key.
#
# @return [user] The user created or found by email.
Creates an user and sends an invitation to him.
If the user is already invited and pending of completing registration
the invitation is resent by email.
If the user is already registered, it returns the user with a
:taken on the email field.
Creates an user and sends an invitation to him . If the user is already invited and pending of completing registration the invitation is resent by email . If the user is already registered it returns the user with a : taken on the email field .
def invite!(attributes={})
        attrs = ActiveSupport::HashWithIndifferentAccess.new(attributes.to_h)
        auth_field = RailsJwtAuth.auth_field_name!
        auth_attribute = attrs.delete(auth_field)
        raise ArgumentError unless auth_attribute
        record = RailsJwtAuth.model.find_or_initialize_by(auth_field => auth_attribute)
        record.assign_attributes(attrs)
        record.invite!
        record
      end
def invite! ( attributes = { } ) attrs = ActiveSupport :: HashWithIndifferentAccess . new ( attributes . to_h ) auth_field = RailsJwtAuth . auth_field_name! auth_attribute = attrs . delete ( auth_field ) raise ArgumentError unless auth_attribute record = RailsJwtAuth . model . find_or_initialize_by ( auth_field => auth_attribute ) record . assign_attributes ( attrs ) record . invite! record end
Creates an user and sends an invitation to him.
Creates an user and sends an invitation to him .
The user created or found by email.
The user created or found by email .
user
attributes
attributes Hash containing user's attributes to be filled. Must contain an email key.
attributes Hash containing user ' s attributes to be filled . Must contain an email key .