Browse Source

lk | removes ready-for-pickup bikes list

master
Louis Knapp 9 years ago
parent
commit
6f435c9ec4
  1. 4
      app/controllers/freecyclery_controller.rb
  2. 4
      app/models/bike.rb
  3. 15
      app/views/freecyclery/ready_for_pickup.html.haml
  4. 2
      app/views/static_pages/home.html.haml
  5. 1
      config/routes.rb

4
app/controllers/freecyclery_controller.rb

@ -5,10 +5,6 @@ class FreecycleryController < ApplicationController
@closed_applications = Client.closed_applications
end
def ready_for_pickup
@bikes_for_pickup = Bike.bikes_ready_for_pickup
end
def available_bikes
@available_bikes = Bike.available_for_freecyclery
end

4
app/models/bike.rb

@ -33,10 +33,6 @@ class Bike < ActiveRecord::Base
self.client && !client.application_voided && self.date_sold.nil?
end
def self.bikes_ready_for_pickup
Bike.all.select{|bike| bike.ready_for_pickup?}
end
def self.available_for_freecyclery
assigned_bikes = Client.all.select{|c| !c.bike_id.nil?}.map(&:bike)
all_freecyclery_bikes = Bike.order(log_number: :desc).select{|bike| bike.purpose == "Freecyclery"}

15
app/views/freecyclery/ready_for_pickup.html.haml

@ -1,15 +0,0 @@
.container
%br
%h1 Freecyclery Bikes for Pickup
%table.table.table-striped.table-bordered.table-hover
%thead
%tr
%th Bike
%th Client
%tbody
- @bikes_for_pickup.each do |bike|
%tr
%td= bike.name
%td= bike.client.name

2
app/views/static_pages/home.html.haml

@ -15,8 +15,6 @@
%br
= link_to "Freecyclery Agencies", agencies_path
%br
= link_to "Freecyclery Bikes Ready for Pickup", ready_for_pickup_path
%br
= link_to "Freecyclery Closed Applications", closed_applications_path
%br
= link_to "Available Bikes", available_bikes_path

1
config/routes.rb

@ -21,7 +21,6 @@ Bikedb::Application.routes.draw do
end
get 'closed_applications' => 'freecyclery#closed_applications'
get 'ready_for_pickup' => 'freecyclery#ready_for_pickup'
get 'available_bikes' => 'freecyclery#available_bikes'
get 'bikes_sold_per_year' => 'reports#bikes_sold_per_year'
end

Loading…
Cancel
Save