I’m still learning where methods go when writing ruby on rails applications. I read something earlier today (and had read it before) that you need to think “tell, don’t ask” when it comes to methods. So basically when working with an object, if you want it to do something, you tell it to do that. This method will then go into the model and get called with @object.method. So, in my application, after an applicant is saved. I want to send a message to the object to send email to that applicant. I had this in the controller, but now I’m pretty sure that this belongs in the model. It ends up looking like this:
I just got back from a long weekend spent in Pittsburgh. I went there to attend Steel City Ruby Conf, which was pretty good. The first day had a lot of self-described “touchy-feely” talks, which I wasn’t crazy about, but understood why they were being given. Though Julie Pagano’s talk on Front-End Development was pretty good and Jim Weinrich’s “Friendly Flying Robots” was a lot of fun. The talks on Day 2 were much more what I was looking forward to. The talk on git by the Steven Ball was really informative and I’m hoping I can start using some of his tips right away. Avdi Grimm’s talk on Pair Programming has pretty much convinced me that I should give it a try as soon as I get some time. And Leon Gersing’s inspiring talk was the perfect finish. So, based on the strength of those talks, I feel it was a pretty good conference.
I took a few days this week and got to work on the tile floor in the kitchen. I had hoped to get more of it finished, but ran out of thin set mortar and energy. Thankfully, Julie came over to visit and Paul brought us both lunch, so I had a lovely lunch with them. Not sure if I’ll be able to finish it tomorrow, so I this may be on hold for a week or so. Going to try to just be satisfied with what I got done today.
Finally got around to posting all the pictures I took on our trip to Michigan. They’re here.
In my app, there are a list of files that people need to upload. I had set things up so that they could pick the type of file from a dropdown list. The list of files are:
It probably says something about me (that I wouldn’t like) that a thoroughly enjoyable evening to me is to have a baseball game on while assembling a cabinet in my pajamas. I bought two cabinets yesterday and put together my first one today.
I made my first repairs today.
These are just some notes on doing everything in rails by hand.
I’m starting a new rails app, using Rails4, and am trying to do more things by hand instead of depending on generators. I actually think generators are great, but I want to better understand how all the parts fit together. So I want to know how to do things by hand, instead of depending on the generators.
That’s basically it for gutting the kitchen.
I got a lot done today. But pulling up floor boards is hard on my back. And by around lunchtime, I knew I was done for the day. I got most of the room done and generated a large amount of garbage, which is basically how I measure how much I worked.
My sister has returned to town, so I had to return her car, making me carless for the time-being. I have finally decided on a car and was supposed to go and pick it up today. But, because I’m a moron, I forgot to call my insurance company to pay for insurance on my brand-new car. So, I decided to postpone picking up the car until Monday.
Since I was feeling depressed after realizing how much there still is to do on the kitchen, I thought I should take a minute to see how far I’ve come. Below are some pictures I took on the final walkthru of the house when I bought it in 2005 and how it looks now. Eight years of my life. Not sure it was worth it.
I finally finished taking down the walls in the kitchen, though I think I still have to pull off those furring strips. However, I have generated a ton of garbage, so I’ll hold off on that for now. I also have to make the wall between the kitchen and dining room into a half wall, but that can come later. I think the next step will be to rip out the floor down to the subfloor. After that, I’m not sure. I may have to consult with Mick.
Mickey the Great came over today and we moved the gas line in my kitchen. As an added bonus, we put in some shutoff valves which I was missing. And lastly, we fully disconnected the dishwasher. We also hauled it out to the alley and two hours later, it’s already gone. Now I’ll be able to put out my beautiful old stove (that has a hole in the side) as well.
There will be no more cooking or cleaning at my house for the foreseeable future. I just finished removing the sink. It’s somewhat depressing thinking about how much more work I have to do.
Yesterday was the annual Run for Hope that I’ve been doing the past few years. This year, as usual, I was racing my now 13-year old nephew Jack. He beat me last year by seven minutes and my goal was to get that down to five this year.
I offered to drive my Mom and my aunt anywhere they wanted. They chose to go to Bohemia National Cemetery. It didn’t take too long and we found what we were looking for.
I have had two snakes (that I’ve seen) in my backyard for as long as I’ve owned my house. For the most part, they can do whatever they want back there and I don’t care. I usually only see them when I’m cutting the grass and they quickly slide away. Today, the grass was a little taller and I didn’t see one of them and I think I killed him. I feel pretty bad about this.
In one of my apps, the price of registration for an event goes up after a particular date. So I have to check if today’s date is after the given date. Here’s how I’ll do this:
Had to fill my garbage cans again, so I took out a cabinet. Now I need to put a valve on my gas line, so I can disconnect the stove. And then it will be time to get rid of the sink. At that point, I’ll be sad because washing dishes will be a pain. (I’m thinking I’ll just go and buy paper plates and cups.)
I signed up to the Five Boro Bike Tour in NYC over last weekend. I took my folding bike on Amtrak and it was a pretty good trip. It would have been great, but Amtrak is definitely not the way to travel. (Next time I want to go somewhere on a train, I first need to go to Europe.) As this was my first vacation in a while, I was very much looking forward to it.
Our datalogger saves files in a windows format, which means when I open it in a unix program, I don’t see any line feeds. The quick solution to this is to open the file in vim and run:
I took the morning and tried to take down a bit more of the wall in the kitchen. It was nice being able to stand on the counter to reach the high parts. Here’s how things look now.