adds Valuator
This commit is contained in:
@@ -12,6 +12,7 @@ class User < ActiveRecord::Base
|
||||
|
||||
has_one :administrator
|
||||
has_one :moderator
|
||||
has_one :valuator
|
||||
has_one :organization
|
||||
has_one :lock
|
||||
has_many :flags
|
||||
@@ -92,6 +93,10 @@ class User < ActiveRecord::Base
|
||||
moderator.present?
|
||||
end
|
||||
|
||||
def valuator?
|
||||
valuator.present?
|
||||
end
|
||||
|
||||
def organization?
|
||||
organization.present?
|
||||
end
|
||||
|
||||
6
app/models/valuator.rb
Normal file
6
app/models/valuator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Valuator < ActiveRecord::Base
|
||||
belongs_to :user, touch: true
|
||||
delegate :name, :email, to: :user
|
||||
|
||||
validates :user_id, presence: true, uniqueness: true
|
||||
end
|
||||
Reference in New Issue
Block a user