Browse Source

lk | adds sidekiq ui

master
Loos 9 years ago
parent
commit
21ee498970
  1. 1
      Gemfile
  2. 7
      Gemfile.lock
  3. 3
      app/models/client.rb
  4. 4
      config/routes.rb
  5. 10
      lib/tasks/bikeloader.rake

1
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'

7
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)

3
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

4
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

10
lib/tasks/bikeloader.rake

@ -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
Loading…
Cancel
Save