Sha256: 15c00a604c7aedd9597dc929321310fcc0bd287659672da97f640a00eb151f4c

Contents?: true

Size: 573 Bytes

Versions: 31

Compression:

Stored size: 573 Bytes

Contents

class UserAttribute < ActiveRecord::Base
  belongs_to :user


# Finds the user_attributes based on login
# @param [sting] login the login of the user
# @return the user attribute object or nil
 def self.find_by_login(login)
    user = User.find_by_login(login)
    if user
      UserAttribute.find_by_user_id(user.id)
    else
      nil
    end
  end

# Concatenates first and last name
# @return [string] the first_name + last_name
  def full_name
    fn = first_name.nil? ? "" : first_name
    ln = last_name.nil? ? "" : last_name
    [fn, ln].join(" ").strip
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hydra-head-4.0.0 app/models/user_attribute.rb
hydra-head-4.0.0.rc6 app/models/user_attribute.rb
hydra-head-4.0.0.rc5 app/models/user_attribute.rb
hydra-head-4.0.0.rc4 app/models/user_attribute.rb
hydra-head-4.0.0.rc3 app/models/user_attribute.rb
hydra-head-4.0.0.rc2 app/models/user_attribute.rb
hydra-head-3.3.0 app/models/user_attribute.rb
hydra-head-3.2.2 app/models/user_attribute.rb
hydra-head-3.2.1 app/models/user_attribute.rb
hydra-head-3.2.0 app/models/user_attribute.rb
hydra-head-3.2.0.pre3 app/models/user_attribute.rb
hydra-head-3.2.0.pre2 app/models/user_attribute.rb
hydra-head-3.2.0.pre1 app/models/user_attribute.rb
hydra-head-3.1.5 app/models/user_attribute.rb
hydra-head-3.1.4 app/models/user_attribute.rb
hydra-head-3.1.3 app/models/user_attribute.rb
hydra-head-3.1.2 app/models/user_attribute.rb
hydra-head-3.1.1 app/models/user_attribute.rb
hydra-head-3.1.0 app/models/user_attribute.rb
hydra-head-3.1.0.rc2 app/models/user_attribute.rb