Browse Source

lk | time spent is now a decimal with precision 2

master
Louis Knapp 7 years ago
parent
commit
dcb91db596
  1. 2
      app/views/bikes/_fields.html.haml
  2. 5
      db/migrate/20170824154325_convert_time_worked_to_decimal.rb
  3. 4
      db/schema.rb
  4. 1
      docs/notes.md

2
app/views/bikes/_fields.html.haml

@ -64,7 +64,7 @@
.form-group
= f.label "Time Spent (Hours)", class: "col-sm-4 control-label"
.col-sm-6
= f.text_field :time_spent, class: "form-control", type: "number", disabled: disabled
= f.text_field :time_spent, class: "form-control", type: "number", step: "0.01", disabled: disabled
.row
.col-sm-6

5
db/migrate/20170824154325_convert_time_worked_to_decimal.rb

@ -0,0 +1,5 @@
class ConvertTimeWorkedToDecimal < ActiveRecord::Migration
def change
change_column :bikes, :time_spent, :decimal, precision: 10, scale: 2
end
end

4
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: 20170713233459) do
ActiveRecord::Schema.define(version: 20170824154325) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -46,7 +46,7 @@ ActiveRecord::Schema.define(version: 20170713233459) do
t.datetime "date_sold"
t.integer "bike_index_id"
t.datetime "fixed_at"
t.integer "time_spent"
t.decimal "time_spent", precision: 10, scale: 2
end
create_table "clients", force: :cascade do |t|

1
docs/notes.md

@ -1,4 +1,5 @@
# Features
- price is a string
- search bikes via brand, make, or serial number.
- add mechanics table and change text input to a dropdown
- printing a single freecyclery receipt from the client page uses the

Loading…
Cancel
Save