Commit 951e5c6

mo khan <mo@mokhan.ca>
2016-07-20 02:45:46
add actual_duration to sets.
1 parent 3b111ed
app/models/exercise_set.rb
@@ -1,5 +1,6 @@
 class ExerciseSet < ApplicationRecord
-  attr_accessor :actual_duration
+  attribute :actual_repetitions, :integer
+  attribute :actual_duration, :integer
   attribute :target_weight, :quantity
   belongs_to :exercise
   belongs_to :workout
db/migrate/20160720022923_add_actual_duration_to_exercise_sets.rb
@@ -0,0 +1,5 @@
+class AddActualDurationToExerciseSets < ActiveRecord::Migration[5.0]
+  def change
+    add_column :exercise_sets, :actual_duration, :integer
+  end
+end
db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20160719020232) do
+ActiveRecord::Schema.define(version: 20160720022923) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -26,6 +26,7 @@ ActiveRecord::Schema.define(version: 20160719020232) do
     t.uuid     "workout_id"
     t.string   "type",               null: false
     t.integer  "target_duration"
+    t.integer  "actual_duration"
     t.index ["exercise_id", "workout_id"], name: "index_exercise_sets_on_exercise_id_and_workout_id", using: :btree
     t.index ["exercise_id"], name: "index_exercise_sets_on_exercise_id", using: :btree
   end
@@ -61,7 +62,7 @@ ActiveRecord::Schema.define(version: 20160719020232) do
 
   create_table "profiles", id: :uuid, default: -> { "uuid_generate_v4()" }, force: :cascade do |t|
     t.uuid     "user_id",                          null: false
-    t.integer  "gender",           default: 0
+    t.integer  "gender",           default: 0,     null: false
     t.integer  "social_tolerance"
     t.datetime "created_at",                       null: false
     t.datetime "updated_at",                       null: false