Skip to content
Snippets Groups Projects
Unverified Commit d4b99b28 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

#9

parent aad2ebf7
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,8 @@
# fk_rails_... (university_id => universities.id)
#
class User < ApplicationRecord
# In this order, "resize avatar" callback will be fired after the others.
include WithAvatar
include WithAuthentication
include WithRoles
include WithSyncBetweenUniversities
......@@ -60,11 +62,9 @@ class User < ApplicationRecord
belongs_to :university
belongs_to :language
has_one :researcher, class_name: 'Research::Researcher'
has_one_attached_deletable :picture
scope :ordered, -> { order(:last_name, :first_name) }
def to_s
"#{first_name} #{last_name}"
end
......
module User::WithAvatar
extend ActiveSupport::Concern
included do
has_one_attached_deletable :picture
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment