diff --git a/app/controllers/bikes_controller.rb b/app/controllers/bikes_controller.rb index 1098e54..ae25673 100644 --- a/app/controllers/bikes_controller.rb +++ b/app/controllers/bikes_controller.rb @@ -91,7 +91,6 @@ class BikesController < ApplicationController :serial_number, :tag_info, :mechanic, - :completion_date, :price, :top_tube_size, :seat_tube_size, diff --git a/app/models/bike.rb b/app/models/bike.rb index 1230744..f5a54ae 100644 --- a/app/models/bike.rb +++ b/app/models/bike.rb @@ -30,8 +30,7 @@ class Bike < ActiveRecord::Base end def ready_for_pickup? - client = self.client - client && self.completion_date && !client.application_voided && self.date_sold.nil? + self.client && !client.application_voided && self.date_sold.nil? end def self.bikes_ready_for_pickup @@ -40,7 +39,7 @@ class Bike < ActiveRecord::Base 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.completion_date && (bike.purpose == "Freecyclery")} + all_freecyclery_bikes = Bike.order(log_number: :desc).select{|bike| bike.purpose == "Freecyclery"} all_freecyclery_bikes - assigned_bikes end diff --git a/db/migrate/20151013231450_remove_completion_date_from_bikes.rb b/db/migrate/20151013231450_remove_completion_date_from_bikes.rb new file mode 100644 index 0000000..f4648ae --- /dev/null +++ b/db/migrate/20151013231450_remove_completion_date_from_bikes.rb @@ -0,0 +1,5 @@ +class RemoveCompletionDateFromBikes < ActiveRecord::Migration + def change + remove_column :bikes, :completion_date + end +end diff --git a/db/schema.rb b/db/schema.rb index 00330ec..7960cc3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150930005913) do +ActiveRecord::Schema.define(version: 20151013231450) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -36,7 +36,6 @@ ActiveRecord::Schema.define(version: 20150930005913) do t.string "serial_number" t.text "work_done" t.text "new_parts" - t.string "completion_date" t.string "price" t.datetime "created_at" t.datetime "updated_at" @@ -57,7 +56,6 @@ ActiveRecord::Schema.define(version: 20150930005913) do t.integer "age" t.boolean "helmet" t.boolean "lock" - t.date "completion_date" t.datetime "created_at" t.datetime "updated_at" t.integer "bike_id" diff --git a/lib/tasks/dummydata.rake b/lib/tasks/dummydata.rake index 1def745..7cec439 100644 --- a/lib/tasks/dummydata.rake +++ b/lib/tasks/dummydata.rake @@ -57,7 +57,6 @@ namespace :db do serial_number: Faker::Number.number(10), notes: Faker::Lorem.sentence, tag_info: Faker::Lorem.sentence, - completion_date: rand(100.days).ago, price: rand(400) + 50, seat_tube_size: rand(45), top_tube_size: rand(45), diff --git a/notes.txt b/notes.txt index 9920283..2f06edb 100644 --- a/notes.txt +++ b/notes.txt @@ -1,5 +1,3 @@ -make sure you can mark bike completion dates - Freecyclery Receipts convert to bootstrap-less