Giter Club home page Giter Club logo

06-23-wellness_tracker's People

Contributors

gmfholley avatar

Watchers

 avatar  avatar

06-23-wellness_tracker's Issues

Feedback for Refactoring

I could probably do more. But I have to stop sometime.

I added some helper methods to create html outside my erb files, but I wasn't sure how to make those methods small. And I'm not sure how readable they are. I tried two styles - one big quote in html style, and one with a line for each html tag.

I didn't update to activerecord, but I did update my database_controller file to start handling some of the validation and data-type conversion that was so messy before. I added a post_initialize method that can hook into the initialize method of each class and a validate_field_types method that I run first in each class's valid? method. Then the classes just validate special business logic like dates and integer ranges.

I might try activerecord for my next project.

Get Approval for Models & Tables

Person Table Description
id Integer PRIMARY KEY
name Text
Exercise Types Description
id Integer PRIMARY KEY
name Text
point_base Integer
Intensity Description
id Integer PRIMARY KEY
name Text
point_adjustment Integer
Duration Description
id Integer PRIMARY KEY
name Text
num_quarter_hours Integer
Exercise Event Description
id Integer PRIMARY KEY
person_id Integer FOREIGN KEY NOT NULL
exercise_type Integer FOREIGN KEY NOT NULL
date Integer NOT NULL
intensity Integer FOREIGN KEY NOT NULL
duration Integer FOREIGN KEY NOT NULL
points Integer DEFAULT 0

Within the Exercise Event table, the combination of user_id, exercise_type and date should be unique.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.