overriding the #name attribute
This commit is contained in:
parent
b18e302224
commit
922e94649d
1 changed files with 4 additions and 0 deletions
|
|
@ -53,6 +53,10 @@ class User < ActiveRecord::Base
|
|||
},
|
||||
presence: true
|
||||
|
||||
def name
|
||||
self[:name] || username
|
||||
end
|
||||
|
||||
def subscribed? conference
|
||||
self.subscriptions.find_by(conference_id: conference.id).present?
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue