Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DashboardController < ApplicationController
- before_filter :login_required
- def index
- unless current_user.admin?
- @users = current_user.company.users if current_user.company
- @company = current_user.company
- @orders = Order.paginate :all, :page => params[:page], :conditions => { :company_id => current_user.company.id, :status => 'draft' } unless current_user.company.nil?
- else
- if params[:date]
- @date = Date.parse(params[:date])
- else
- @date = Date.today
- end
- @deliveries = Order.find(:all, :conditions => ["delivery_date = ? AND status = ?", @date, 'confirmed_by_administration'])
- @pickups = Order.find(:all, :conditions => ["delivery_date = ? AND status != ?", @date + 1, "draft"])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement