Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rake from 10.1.1 to 12.3.3 #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ GEM
activesupport (= 4.0.2)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
rake (12.3.3)
rdoc (3.12.2)
json (~> 1.4)
remotipart (1.2.1)
Expand Down
4 changes: 3 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
== Weightable
==========

== hello

Weightable allows users to track his or her weight, upload photos, and receive encouragement from friends.


Expand All @@ -12,6 +14,6 @@ Inside Weightable I used the following technologies:
* Devise for user authentication
* Amazon S3 for remote image storage
* jQuery JavaScript library
* Remotipart to enable AJAX file uploads with jQuery
* Remotipart to enable AJAX file uploads with jQuery


Binary file added app/assets/images/mickey-mouse-large.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class User < ActiveRecord::Base
mount_uploader :pic, ImageUploader

def self.bmi(user)
if user.weights.last && user.height_feet && user.height_in
if user.weights.last && !user.height_feet.empty? && !user.height_in.empty?
current_weight=user.weights.last.weight.to_f
height_in_inches = (user.height_feet.to_f*12)+user.height_in.to_f
((current_weight*703)/(height_in_inches**2)).round(2)
Expand All @@ -32,15 +32,15 @@ def self.bmi(user)
def self.bmi_translate(bmi)
case bmi
when 0.0..18.4
"underweight"
"- underweight"
when 18.5..24.9
"normal weight"
"- normal weight"
when 25.0..29.9
"overweight"
"- overweight"
when 30.0..100
"obese"
"- obese"
else
"n/a"
""
end
end

Expand Down
5 changes: 4 additions & 1 deletion app/views/users/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
- @users.each do |user|
-next if user == current_user
.prof.backs
%img{src: user.pic_url(:medium)}
-if user.pic_url.nil?
=image_tag("mickey-mouse-large.jpg")
-else
%img{src: user.pic_url}
%h4= link_to user.name, user
%h6= "Goal: #{user.goal}"
-if current_user.friends.include?(user)
Expand Down
12 changes: 9 additions & 3 deletions app/views/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
.row
.backs.large-12.columns
.large-3.columns
%img{src: @user.pic_url}
-if @user.pic_url.nil?
=image_tag("mickey-mouse-large.jpg")
-else
%img{src: @user.pic_url}
.large-9.columns
.row
.large-3.columns
Expand All @@ -18,12 +21,15 @@
.large-3.columns
%h4.subheader Goal Weight
.large-9.columns
%h3= @user.goal
-if @user.goal
%h3= @user.goal
-elsif current_user == @user
%h3=link_to "add goal weight", edit_user_registration_path
.row
.large-3.columns
%h4.subheader BMI
.large-9.columns
%h3="#{@bmi} - #{@bmi_translation}"
%h3="#{@bmi} #{@bmi_translation}"
.large-6.columns.no-right-pad
.backs.no-margin
%h3 Past Weights
Expand Down
9 changes: 7 additions & 2 deletions app/views/weights/_weight.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
.weight-box.weightid{"data-id" => weight.id}
.profile-info.columns.large-12
.first-inner-box.large-3
.weight-box-profile_pic= image_tag weight.user.pic
.weight-box-profile_pic
-if weight.user.pic.url.nil?
=image_tag("mickey-mouse-large.jpg")
-else
=image_tag weight.user.pic
.spacing
.inner-box.large-6
.weight-box-name= link_to weight.user.name, user_path(weight.user.id)
Expand All @@ -15,8 +19,9 @@
%span.weight-num #{weight.user.goal}
.weight
Date: #{weight.date}
-if weight.pic
-if weight.pic
%img{src: weight.pic_url(:medium)}

%br
%br

Expand Down
9 changes: 6 additions & 3 deletions app/views/weights/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
= render 'weights/form'
.row
.large-6.large-centered.columns.weights.backs
- @weights.each do |weight|
= render "weight", weight: weight

-if @weights.empty?
=link_to "Add Friends", root_path
-else
- @weights.each do |weight|
= render "weight", weight: weight