class Katapult::Authentication

Attributes

system_email[RW]

@attr name: The user model name

Public Instance Methods

ensure_user_model_attributes_present() click to toggle source
# File lib/katapult/elements/authentication.rb, line 9
def ensure_user_model_attributes_present
  user_attrs = user.attrs.map(&:name)

  user.attr(:email) unless user_attrs.include?('email')
  user.attr(:password, type: :password, skip_db: true) unless user_attrs.include?('password')
end
render(options = {}) click to toggle source
# File lib/katapult/elements/authentication.rb, line 16
def render(options = {})
  Generators::ClearanceGenerator.new(self, options).invoke_all
end
user() click to toggle source
# File lib/katapult/elements/authentication.rb, line 20
def user
  @user ||= application_model.get_model!(name)
end