lortza / lortza/therapy_tracker

convert burn rep to 2 dropdowns

Open
#14 1 comment 0 reactions 1 assignee View on GitHub

@lortza is already working on this.

Since May 10, 2019.

pair
Dominant language
Ruby
Stars
9
Forks
3
Avg merge
24m
Merged PRs (30d)
11

Description

i'd like to convert the 2.3 style of rep counting to 2 different fields to make the feature easier to use.

  • add burn_set field to exercise_logs table
  • validate burn_set only on update
  • loop over each exercise log record and parse the existing data:
ExerciseLog.all.each do |log|
  if log.burn_set == nil
    if log.burn_rep == nil
      log.burn_set = 0
      log.burn_rep = 0
    else
      nums = log.burn_rep.to_s.split('.')
      log.burn_set = nums.first.to_i
      log.burn_rep = nums.last.to_i
      log.burn_rep = 10 if nums.last.to_i == 1
    end
    log.save
  end
end
  • add dropdowns to the exercise_logs/form
  • add new burn set & rep info to views & partials
  • use JS to limit the set & rep dropdown options to the values that are in the log's form fields (on edit only)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.