Supplier mail changing and polishing

This commit is contained in:
2013-12-11 16:00:35 +01:00
parent 0ac9a70797
commit 8aede39b27
28 changed files with 207 additions and 72 deletions
+1
View File
@@ -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
+5
View File
@@ -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