SB Apprenticeship: Day 63

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Sorry for the lack of posts last Thursday and Friday, folks, I got some bad news and wasn’t feeling particularly social. Unfortunately SB has decided not to extend me a job offer, so the last day of my apprenticeship, and my last day at work, will be this coming Wednesday, Nov. 11th. Fortunately I’m leaving on great terms, so maybe in the future I can join their team for real!

I’m not sure if I’m going to keep up this blog. For the people reading, have you been keeping up solely to learn about the apprenticeship? Would reading about my job search be boring? I’ve liked having the habit of blogging, but it’s much easier when you have a deliberate thing to talk about. Anyway, let me know.

Today I’m going to keep plugging away at the bookstore. I’d really love to be able to finish it and have something nice to show off potential employers. Brandon and I paired Thursday and made some progress on the process of making a customer for Stripe, so they can save a credit card and reuse it. That’s the last big step.

SB Apprenticeship: Day 60

Words of wisdom

Words of wisdom

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Yesterday I learned the value in committing often. I accidentally deleted everything I had done Monday in trying to get rid of some code I wrote while following the wrong path to creating a customer for Stripe. Soooooo, that was frustrating. I got most of it rewritten, but there was a tricky part I had needed help on, and now I can’t remember what we did.

Today I’m going to continue rewriting the code that was lost and then go back to attempting to create a customer in Stripe. Man, I’m so close to finishing this project. I can almost taste it!

I had planned on doing some more Ruby tutorial/Code School/Treehouse stuff today, but Brandon is unexpectedly in the office, so that may change. Today makes 12 weeks since I started my apprenticeship, but I’m still at least a month out from (hopefully) being hired. Brandon told me that they picked 12 weeks fairly arbitrarily and that as long as I was making progress it was fine if I didn’t finish in that time, but it’s still frustrating to be behind. Still, I can tell that I know way more than I did 12 weeks ago, this bookstore project is coming along despite my stupid git tricks, and it’s all going to wind up awesome.

SB Apprenticeship: Day 59

I added a confirmation page!

I added a confirmation page!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Yesterday I started out trying to make a customer in Stripe so I could save a credit card and use it again. I got a bug that I couldn’t figure out, so I decided to move on and make the order confirmation page, which took forever because of lots of little bugs that had to be fixed along the way. I ended the day with the same bug I had started it with, only reached through a very roundabout path. Sigh. But I got the confirmation page working! It’s tricky to test, because I have to put all the info (name, address, email, cc number, etc) in every time, and I have it set to destroy the cart once payment has gone through, so if anything breaks in that process I have to go back and redo the entire thing. So tedious.

Today I am going to hopefully finish working on creating a customer and saving a credit card. The flow for this project seems weird to me, according to the tests I should have a cart, a checkout page (where you put credit card details), a confirmation page *and* an order summary page. Oh, and it sends an email. This seems redundant to me, but maybe there’s some reason for it? I think I’ll ask Brandon his thoughts and maybe that’ll be a step I won’t have to take. I’m so close to being done!

Part of the thing that was confusing me yesterday about saving a credit card was that I have to make a customer (to associate with the cc, which makes sense), but I’m not sure if I have to make a user to go along with that. Or…now that I look at my code, I already have a user model but I don’t have a controller. Soooo maybe I’m just confused. Anyway, I expect to learn what that’s all about and hopefully get that untangled.

Also, if any of the people who read this are in Durham, be sure to vote today!

SB Apprenticeship: Day 58

AAAAAAAAHHHHHHH IT WORKS!!!

AAAAAAAAHHHHHHH IT WORKS!!!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

So…I finally got Stripe working! That was my triumph of the week. Annie had to help me track down a bizarre little bug that was changing my total price to an integer and chopping off the cents that I am absolutely positive that I would never have figured out on my own — all it was saying was that I couldn’t have a charge of less than 50 cents, regardless of the actual total. I thought that it just wasn’t seeing the total, so I fought with that for a while, but Annie realized that if my total was more than $50 I wasn’t getting the error message. My cart had just been so full from my tests that I hadn’t noticed the bug.

I also got emails working!

I also got emails working!

Not only did I get Stripe working, but I managed to get the email to work, too! I practically went on a high-fiving tour of the office at the end of the day.

Today I have a few more things to do to satisfy the Cucumber suite.

  • After you hit ‘Place order’ on the checkout page, you’re supposed to be shown an order total to review before hitting the final ‘Confirm’ button to send the order.
  • After the final confirmation you’re supposed to be shown an order summary
  • Your credit card should be saved for future purchases
  • If you make another order you should be asked if you want to use your saved credit card

I think these will be relatively easy to implement, but with my track record, who knows. I’m pretty sure that it’ll just be a new page to show everything, but I don’t know how to get Stripe to save a credit card, so that may be a challenge.

SB Apprenticeship: Day 57

The ladies of SB made jack-o-lanterns!

The ladies of SB made jack-o-lanterns!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Happy Halloween! And Happy Friday!

Yesterday I worked on my bookstore for a little bit and then wrote a blog post about why I chose SB. Brandon and I paired a bit and I worked on katas.

Today is more of the same. Brandon showed me an actual Rails tutorial for Stripe that I hadn’t found before, so I’m going to work through that. I’m also going to read some more of Eloquent Ruby.

Hopefully I will finally learn how to make Stripe get a customer from my code.

SB Apprenticeship: Day 56

Lookit all those passing tests!

Lookit all those passing tests!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

If this bookstore project has done one thing for my Ruby knowledge, it has made me completely unafraid of migrations. I guess ‘afraid’ is the wrong word, I was just under the impression that they were more significant than they are, like you should only make additional migrations in rare circumstances. Otherwise you should just be able to work around it. Obviously I was pretty wrong there. 🙂

I was able to fix the UnknownFormat error from yesterday, turns out my method was such a mess that it wasn’t even getting to the line where I declared the format. Josh helped prod me in the right direction, and it was on to the next error message! Which is still Stripe error while creating customer: Must provide source or customer. Sigh. Yesterday was Brandon’s day to work from home, but he was able to help me a bit over Slack, and said that he would help me more when we pair today. Since I wasn’t having any success fixing that I decided to work on the Cucumber tests so I wouldn’t be too far behind. I got a lot of them done, until I ran into the test that needs Stripe to work. But getting so many of them done was a relief, since I feel more caught up. Most of the tests that are left are somewhat repetitive, so as soon as we get Stripe working I should be able to fly through them.

Today I’m going to hopefully get the Stripe stuff worked through with Brandon. The documentation stuff for Stripe is good, but it’s not particularly newbie friendly — I don’t actually know where some of the code it gives you goes, for instance. Yet another thing to add to my increasing list of newbie tutorials I should do.

Yesterday Brandon said he was going to show me how to use the element inspector to view the details of network requests, so I can see the data that I’m passing to the Stripe API. I’m looking forward to that; I like learning the little tips and tricks to figure out what’s going on almost more than I enjoy learning to code in general. I also need to make some adjustments to my project based on the tests, one wants an order summary page and another says I should be able to adjust the quantity of books in my cart. So let’s see, today’s todo list is:

  • Figure out why Stripe isn’t seeing my customer
  • Add a summary page
  • Figure out the damned quantity thing
  • Finish Cucumber tests

I expect to learn to how to make the Stripe API talk to my code correctly, and hopefully how to adjust the quantity in my cart. I worked on that for a couple days, until Brandon told me that it wasn’t actually part of the requirements for the project and I didn’t have to do it, which made me happy, because it was way harder than I expected it to be.

SB Apprenticeship: Day 55

I got the form! Now I just need to make it work...

I got the form! Now I just need to make it work…

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

I found an old Railscast that helped me walk through setting up Stripe, which mostly worked, but I keep getting this weird error that google is not particularly helpful with. Anyone have an idea of what Unknown Format means?

ActionController::UnknownFormat

ActionController::UnknownFormat

Google (and by Google, I mean Stack Overflow) seems to think that I need to my respond_to needs to have a format associated with it, but I have format.html { redirect_to books_url }  in the method already. Sigh. This method is kind of a mess, though, so I need to refactor it. Maybe I’ll see if I can get some help with that, since nothing I’ve tried seems to help the situation. I haven’t been sleeping well this week, so I think I’m getting frustrated more easily than usual.

Today I’m going to figure out this method and fix that error, and then finish working through the Stripe tutorial.

I feel like I answer the “what do you expect to learn” part of this prompt with some variation of “…that I’m doing <whatever thing I am working on> wrong” way too often. I’m not always sure how I should be answering this question other than the fairly generic way that I do. Anyway, I expect to learn what that error means and how to fix it. I should probably also figure out how to tell whether or not my emails are sending, and if Stripe is actually charging the fake credit card I’m giving it. Lots to do today!

SB Apprenticeship: Day 54

Now you can check out!

Now you can check out! (Ignore the styling)

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

I have a checkout page now! I followed the tutorial in the Agile Web Development book, so now there’s a purchase button, a separate page to enter purchasing details, and it sends you an email both when you place an order and when it ships. Well, I think it sends an email, I haven’t actually figured out how to test that yet, but the book seemed confident that it would work.

It just occurred to me that one of my “if I win the lottery and don’t ever have to think about money again” daydreams has always been to own a bookstore, and I’ve always wanted to name it “Speak Friend And Enter,” because I’m a gigantic Tolkien nerd, and I’m missing my chance! Why am I naming my bookstore “Jessa’s Bookstore”?! That’s so boring! So anyway, I think I’m going to change that and look forward to the look on Brandon’s face when he sees it. Hee hee.

Today is Stripe day! Much like Rex Manning Day, I’ve been looking forward to this since I started this project. I can’t exactly explain why this has been the detail that I’ve been focusing on, maybe because it actually feels real? I use Stripe, I used it last night to pay for my hot chocolate at Cocoa Cinnamon, and even though this is a fictional bookstore, the ability to add Stripe and make if functional is a precursor to working on real projects at Smashing Boxes. Also, it’s the last major feature to add! So that’s pretty exciting.

I expect to learn that Stripe is incredibly complicated to implement, despite its clear documentation, because that’s just how my life works.

SB Apprenticeship: Day 53

Lookit my index page!

Lookit my index page!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

I ended up getting more done Friday morning than I expected! Now my book index page has a logout link, and all the book titles are links. I added more Faker data (this is rapidly becoming my favorite gem), so when you click on the link, it goes to a book show page that includes a description.

Lorem ipsum is a description, right?

Lorem ipsum is a description, right?

Maybe someday I’ll be less impressed by accomplishing things like this, but for right now I was pretty darn thrilled. Brandon tells me all the time that I need to try random things more often, things that I’m not sure are going to work, which is not a thing I’m particularly good at. He was in a meeting Friday morning, though, and no one was around to answer my question, so I decided to just go for it with the line to make all the book titles links, and it worked! So, you know, positive reinforcement is a thing. 🙂

This week’s ToDo list:

  • Learn hashes (Brandon brought me a copy of Eloquent Ruby to read through)
  • Add a ‘Purchase’ button
  • Add Stripe (making sure that I know about PCI compliance and how it works)
  • Cucumber tests
  • Add the Carrierwave gem? Brandon said it would be super impressive if I could get it working.

I’m pretty excited that the end of the bookstore seems to be in sight. I think I’ve been annoying Brandon by frequently talking about how much I want them to hire me, so I’m going to try to be a little less vocal about it. I think at this point everyone knows I want to work here. Jinxing myself by annoying my mentor would just be tragic.

I had this grand plan of working on all the various courses about hashes this weekend, but then my boyfriend got a nasty bite from our cat, so instead it was taken up with Urgent Care, gauze and alarms to make sure he took his antibiotics. I think I may work on the purchase button and then read Eloquent Ruby in the afternoon. I really need to make sure I have a firm grasp on these basics. Also, I’m way behind in the reading I’ve been supposed to do for this apprenticeship, so I should maybe focus more on that.

SB Apprenticeship: Day 52

It’s Smashing Boxes’ 5th birthday! We’re having a field day this afternoon! I’m mostly hoping there will be cake. 🙂

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Yesterday I got a lot done: I finally got the cart to show up on the homepage and populate with the number of items that were in it, Brandon and I fixed a wonky thing that was allowing me to save negative books as long as I had copies of that book already in my cart, I figured out how to make case insensitive search work (add a freaking I in front of LIKE in postgreSQL, sigh) and we determined that the acceptance criteria for the bookstore doesn’t currently require me to be able to increment books in the cart, so I’m just not going to do that. Apparently after I finish Brandon’s going to challenge me to add one more feature, which might be the incrementing thing, but I’m going to worry about that when it happens.

We also determined that I have somehow not managed to retain any of the things I learned about hashes. I know the basics about them, but when it comes time to manipulate them I just never can remember how. Brandon is going to loan me his copy of Eloquent Ruby and wants me to read at least the first half. He mentioned that my pairing tour is at least partly a judgement of my skills; the pairings with iOS, Front End and Android people won’t be, obviously, but when I pair with Brandon, Patrick, Joe or the other back end folks, they’ll be watching and have the ability to give me a thumbs down when it comes time to decide whether or not they’re going to hire me. Treehouse has a course on hashes that I’m going to work on this weekend too, I think. This is really basic stuff that I need to understand. I got Kevin to explain it to me yesterday, and it made sense, so either there’s some sort of disconnect between having it explained and actually doing it, or the third time’s the charm and it finally just actually clicked.

So, realistically speaking, I’m not going to get a lot done today: we have our backend standup at 9:30, the company-wide standup at noon and then field day, but I’m going to add the list of things I need to do in order to have it in one place that isn’t a raggedy index card.

  • Learn hashes
  • Add a page to show book details
  • Cucumber tests
  • Add logout
  • Remove the number box for quantity
  • Add the Carrierwave gem? Brandon said it would be super impressive if I could get it working.
  • Make sure and learn about PCI compliance when I add Stripe to my bookstore. Apparently the documentation is so good that it’s easy to just install it with no actual understanding of what’s happening. I guess good documentation is a double-edged sword.

Today I expect to remember how to add a logout button and change a number field to a text so I don’t have to worry about the incrementing stuff yet. I feel like those are two things I can definitely get done this morning.