Class: Ronin::DB::UserName
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::UserName
- Includes:
- Model, Model::HasUniqueName, Model::Importable
- Defined in:
- lib/ronin/db/user_name.rb
Overview
Represents a user name and their associated credentials or email addresses.
Instance Attribute Summary collapse
-
#created_at ⇒ Time
readonly
Tracks when the user-name was created.
-
#credentials ⇒ Array<Credential>
Any credentials belonging to the user.
-
#email_addresses ⇒ Array<EmailAddress>
The email addresses of the user.
-
#id ⇒ Integer
The primary key of the user name.
Attributes included from Model::HasUniqueName
Class Method Summary collapse
-
.import(name) ⇒ UserName
Imports a user name.
-
.lookup(name) ⇒ UserName?
Looks up the user name.
Methods included from Model::HasUniqueName
Methods included from Model::Importable
Methods included from Model
Instance Attribute Details
#created_at ⇒ Time (readonly)
Tracks when the user-name was created.
51 |
# File 'lib/ronin/db/user_name.rb', line 51 attribute :created_at, :datetime |
#credentials ⇒ Array<Credential>
Any credentials belonging to the user.
57 |
# File 'lib/ronin/db/user_name.rb', line 57 has_many :credentials, dependent: :destroy |
#email_addresses ⇒ Array<EmailAddress>
The email addresses of the user.
63 |
# File 'lib/ronin/db/user_name.rb', line 63 has_many :email_addresses, dependent: :destroy |
#id ⇒ Integer
The primary key of the user name.
45 |
# File 'lib/ronin/db/user_name.rb', line 45 attribute :id, :integer |
Class Method Details
.import(name) ⇒ UserName
Imports a user name.
87 88 89 |
# File 'lib/ronin/db/user_name.rb', line 87 def self.import(name) create(name: name) end |
.lookup(name) ⇒ UserName?
Looks up the user name.
74 75 76 |
# File 'lib/ronin/db/user_name.rb', line 74 def self.lookup(name) find_by(name: name) end |