A good plan brings a better result and a better process
JavaScript is much different than any of the other languages I have learned, but as a compiled language, it obviously has similarities to the other languages. The syntax of JavaScript initially gave me problems but after practicing outside the Flatiron curriculum, I could identify syntax errors quickly. Building the basic API portion of the project went well, but once I added in the comments, I had to figure out how to combine the comments with the proper fast. During that process, I also needed to calculate the number of hours for the fast. I used a class method within the Fast model for this:
def calculate_hours
final_time = self.active ? Time.now.to_time : self.updated_at.to_time
fast_seconds = final_time - self.created_at.to_time
fast_minutes = fast_seconds/60
fast_hours = (fast_minutes/60).floor
fast_left_minutes = fast_minutes - (fast_hours * 60)
return { hours: fast_hours, minutes: fast_left_minutes.floor }
end
I can’t believe how long this has taken!! Time and life has just swept me along and this Rails Project seemed to be never-ending!!
Getting my Rails project done was like climbing a mountain–NOT because the curriculum was so super difficult, but because my life took a super sharp, horrible turn.
Well, at least this time I didn’t have that coding freeze going on!! I knew what I wanted to build and I knew that I wanted to build it from scratch!! I didn’t want to try to figure out what I needed and didn’t need from Corneal.