How to construct a better commit message using Vim editor?The purpose of this tutorial is to teach you to create better commit messages so the reviewer can do a more thorough review.At first, It is confusing to use the Vim editor, but I did some research and documented a step by step process to do it:
git add .
to add your changes to your upcoming commit.Step 2: Open a Vim editor.
This was after I rolled back the last migration that creates the `Comment` model, added a `is_public` boolean attribute to it, then rerunning the migration.Then I started working on the controller for the commenting feature. Doing TDD while implementing the updates on the controller when I noticed my tests fail while the controller seems to work as expected when doing the workflow on the browser.In the development database the boolean attribute is reflecting but not in the tes...
This thought started when I read one of an interns chat on Campfire regarding one of our internal project involving property rentals. The question was:As a renter, how do I actually apply for a rental property?
Although the intern has fixed a few bugs on the project, he is still not familiar with all the functionalities of the application. This is not a unique situation, I for one have been in this kind of situation before. You al...
This week while I was responding to one of the OJT applications, I found out one of the answers was an exact replica of a blog article. The question was "What happens when you type an URL in the browser and press enter? Assume that you are accessing a typical PHP website. Please explain in detail.". The answer was an exact replica of this an article from a blog post from Medium. It reminded me about a quote that was popularized by Steve Jobs. "Good artists cop...
One of the web applications we are working on here in Bootyard is a rental platform where users can lend and rent items online.
The platform has many features that make rental transactions easy online. Some of the features are pages where the user uploaded pictures and details of items can be categorically viewed, via categorised pages, and also be searched via a page with a search form.
The pages where you can see the uploaded items hav...
There are two steps in Heroku in syncing production database to staging database.
STEP 1: Create a duplicate of production database into your local.
`pg:pull` can be used to pull remote data from a Heroku Postgres database to a database on your local machine. The command looks like this:
heroku pg:pull DATABASE_URL [local-database] --app [app-name-of-your-prod-database]
This command creates a n...
When reading Ruby on Rails code, I find it difficult to understand code where the "business logic" is scattered between controllers and model.
How do your make code more readable? Specifically how do you make Ruby on Rails code more readable?
The solution is based on this discussion:
The idea that I got from the vid...
We had a Rental model that had a column which is an enum type.
class Rental < ApplicationRecord enum delivery_and_return_type: %i[pickup courier post]
We needed to remove the "courier" option on the enum.
We created a migration to remove the "courier" type and change all existing delivery_and_return_type into a "post". The migration implementation is this:
When should you use a helper method vs a model method?
IMHO, you have to read the entire codebase in order to decide whether you put the method on a model or a helper.
Here's an example on one of our project, the Listing model has these new methods:
class Listing < ApplicationRecord def seven_day_pickup_cost seven_day_rental_price.to_i + cleaning_fee end def seven_day_post_cost seven_day_rental_price.to...
There are a lot of success stories we can read online about non-technical founders that started out with a great idea and have successfully grown their startup into a profitable company even if they don’t have a technical background. A few list of non-technical founders are marketers, real estate brokers, teachers, public relations officers, financial analysts and more. Then we ask how did they do it? How did they manage to build their idea into a working product without any technical experti...