Move supplier full pull to being an api for the ember app and handle login and authorization a little bit better (should be even a lot better in the future)
This commit is contained in:
@@ -5,6 +5,7 @@ class EmployeeShift
|
||||
property :start_from
|
||||
property :end_on
|
||||
property :description
|
||||
property :full_day, type: :boolean, default: false
|
||||
|
||||
belongs_to :supplier
|
||||
belongs_to :employee
|
||||
@@ -12,6 +13,7 @@ class EmployeeShift
|
||||
validates :start_from, presence: true
|
||||
validates :end_on, presence: true
|
||||
|
||||
view :by_supplier_id_and_id, key: [:supplier_id, :_id] # supplier safe find
|
||||
view :for_supplier_view, type: :custom, map_function: %|function(doc){
|
||||
if(doc.ruby_class == 'EmployeeShift' && doc.start_from && doc.end_on){
|
||||
emit([doc.supplier_id, doc.end_on], 1)
|
||||
|
||||
Reference in New Issue
Block a user