Class: UserAttribute

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
vendor/plugins/hydra_repository/app/models/user_attribute.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) find_by_login(login)

Finds the user_attributes based on login

Returns:

  • the user attribute object or nil



8
9
10
11
12
13
14
15
# File 'vendor/plugins/hydra_repository/app/models/user_attribute.rb', line 8

def self.()
  user = User.()
  if user
    UserAttribute.find_by_user_id(user.id)
  else
    nil
  end
end

Instance Method Details

- (string) full_name

Concatenates first and last name

Returns:

  • (string)

    the first_name + last_name



19
20
21
22
23
# File 'vendor/plugins/hydra_repository/app/models/user_attribute.rb', line 19

def full_name
  fn = first_name.nil? ? "" : first_name
  ln = last_name.nil? ? "" : last_name
  [fn, ln].join(" ").strip
end