Mostly enriching supplier's user info with number of lists finished at the restaurant
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
||||
class User
|
||||
include SimplyStored::Couch
|
||||
include ActiveModel::SerializerSupport
|
||||
attr_accessor :number_of_lists_at_supplier
|
||||
|
||||
property :name
|
||||
property :active_list_id
|
||||
@@ -93,7 +94,8 @@ class User
|
||||
|
||||
# This is the user name as it is shown to the supplier
|
||||
def supplier_name
|
||||
auth_data['info']['name'] rescue I18n.t('supplier.user.unknown_name')
|
||||
name = auth_data.try(:[], 'info').try(:[], 'name')
|
||||
name || email.to_s.sub(/@.*/, '')
|
||||
end
|
||||
|
||||
# This is the user name as it is shown to other users
|
||||
|
||||
Reference in New Issue
Block a user