Supplier mail changing and polishing
This commit is contained in:
@@ -79,6 +79,7 @@ class List
|
||||
def self.for_supplier(supplier, options = {})
|
||||
total_entries = database.view(for_supplier_view({startkey: ["#{supplier.id}\u9999"], endkey: [supplier.id], include_docs: false, reduce: true, descending: true}))
|
||||
options[:total_entries] = total_entries
|
||||
options[:descending] = true
|
||||
with_pagination_options(options) do |options|
|
||||
database.view(for_supplier_view({startkey: ["#{supplier.id}\u9999"], endkey: [supplier.id], include_docs: true, reduce: false, descending: true}.merge(options)))
|
||||
end
|
||||
|
||||
@@ -50,6 +50,11 @@ class User
|
||||
save
|
||||
end
|
||||
|
||||
# This is the user name as it is shown to the supplier
|
||||
def supplier_name
|
||||
auth_data['info']['name'] rescue I18n.t('user.unknown_supplier_name')
|
||||
end
|
||||
|
||||
def has_active_list?
|
||||
active_list_id.present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user