polyglot/app/models/user.rb

21 lines
546 B
Ruby
Raw Normal View History

class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
has_many :connections
2018-08-29 12:44:10 +00:00
has_many :chat_room_participations
has_many :chat_rooms, through: :chat_room_participations
2018-08-29 12:44:10 +00:00
has_many :requests
2018-08-29 15:58:21 +00:00
mount_uploader :photo, PhotoUploader
def contacts
self.connections.map do |connection|
connection.contact
end
end
end