From 21ee498970b3e594d7a8a1bc0199adffe60b3cb7 Mon Sep 17 00:00:00 2001 From: Loos Date: Mon, 7 Sep 2015 10:41:03 -0500 Subject: [PATCH] lk | adds sidekiq ui --- Gemfile | 1 + Gemfile.lock | 7 +++++++ app/models/client.rb | 3 ++- config/routes.rb | 4 ++++ lib/tasks/bikeloader.rake | 10 ---------- 5 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 lib/tasks/bikeloader.rake diff --git a/Gemfile b/Gemfile index dbb355a..c5c67d1 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ gem 'faraday', '0.9.1' gem 'oauth2', '1.0.0' gem 'dotenv-rails' gem 'sidekiq' +gem 'sinatra', :require => nil #SCSS & Bootstrap gem 'bootstrap-sass', '2.3.2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8f62103..5c0a8b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -130,6 +130,8 @@ GEM pry-rails (0.3.4) pry (>= 0.9.10) rack (1.5.2) + rack-protection (1.5.3) + rack rack-test (0.6.3) rack (>= 1.0) rails (4.0.1) @@ -201,6 +203,10 @@ GEM json redis (>= 3.0.6) redis-namespace (>= 1.3.1) + sinatra (1.4.5) + rack (~> 1.4) + rack-protection (~> 1.4) + tilt (~> 1.3, >= 1.3.4) slop (3.6.0) sprockets (2.12.3) hike (~> 1.2) @@ -268,6 +274,7 @@ DEPENDENCIES sdoc (= 0.3.20) selenium-webdriver (= 2.35.1) sidekiq + sinatra turbolinks (= 1.1.1) uglifier (= 2.1.1) webmock (= 1.21.0) diff --git a/app/models/client.rb b/app/models/client.rb index fa7f469..8a75806 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -6,7 +6,8 @@ class Client < ActiveRecord::Base def self.waiting_list clients = Client.all non_voided_clients = clients.select{|client| !client.application_voided} - waiting_list = non_voided_clients.select{|client| !client.completion_date} + waiting_list_with_null_application_dates = non_voided_clients.select{|client| !client.completion_date} + waiting_list = waiting_list_with_null_application_dates.select{|client| !client.application_date.nil?} waiting_list.sort_by!{|client| client.application_date} end diff --git a/config/routes.rb b/config/routes.rb index f4944e6..1a7179f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,11 @@ +require 'sidekiq/web' + Bikedb::Application.routes.draw do devise_for :users root to: "static_pages#home" + mount Sidekiq::Web => '/sidekiq' + resources :bikes do get 'print_select' => 'bikes#print_select', on: :collection get 'print_labels' => 'bikes#print_labels', on: :collection diff --git a/lib/tasks/bikeloader.rake b/lib/tasks/bikeloader.rake deleted file mode 100644 index 666fad4..0000000 --- a/lib/tasks/bikeloader.rake +++ /dev/null @@ -1,10 +0,0 @@ -task :load_recyclery_bike_db => :environmnent do - puts "destroying old bike data" - Bike.all.destroy - file = "lib/assets/recyclery_bike_log.txt" - puts "loading bike database from #{file}" - File.foreach(file) do |line| - data = line.split("|") - end -end -