# Using Git Commits to Learn to Program Ruby on Rails

DevFeed: [Using Git Commits to Learn to Program Ruby on Rails](<https://devfeed.tech/articles/using-git-commits-to-learn-to-program-ruby-on-rails-28240.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/rails/2019/11/03/using-git-commits-to-learn-to-program-ruby-on-rails.html>)

Author: Fuzzygroup

Published: 2019-11-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>), [Git](<https://devfeed.tech/topics/git.md>), [GitHub Issues](<https://devfeed.tech/topics/github-issues.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>), [Agile](<https://devfeed.tech/topics/agile.md>), [User Stories](<https://devfeed.tech/topics/user-stories.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [agile](<https://devfeed.tech/tags/agile.md>), [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [github-issues](<https://devfeed.tech/tags/github-issues.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [learning](<https://devfeed.tech/tags/learning.md>), [rails](<https://devfeed.tech/tags/rails.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ruby-on-rails](<https://devfeed.tech/tags/ruby-on-rails.md>)

## AI overview

This article presents a learning technique for Ruby on Rails based on mapping Agile user stories to GitHub Issues, branches, pull requests, and resulting code commits. It illustrates the approach with a Rails data-model and database-migration example.

## Source excerpt

I've been actively working on a side project for the past several months and one of the people who has been helping out a bit around the edges wants to learn how to program Ruby on Rails. Since this, like everything I always do, is a distributed, remote effort, an in person teaching effort just doesn't work. When they pushed back on the feature set I was making and said that it wouldn't work for them, I said "Well that's fine, tell me what you want". And they responded with a detailed set of Agile User Stories. I took a look at these and I realized that if I mapped them into Github issues (aka tickets) and then Github Pull Requests that this might be exactly the right tool to get this person past the learning hump. Note: Just to be clear, it doesn't matter what the side project is. Yes it is live on the Internet but it is buggy as hell. And this is a major new feature. The whole point of this blog post is to talk about a new learning technique not "Scott's (current) Crazy Side Project". Learning from Code Commits The hard part with learning any new development framework is making the leap from "here's what I want" (the story) to "here's what to do to make that" (the code and tooling steps). Now if you use Github how we do, with a simple branch based development model, where 1 issue maps to 1 branch, this means that you can actually look at a user story and then see all the changes. This is a weird enough learning concept that I'm going to illustrate this step by step. Beginning With the Story Let's start with the agile user story: As a user, I want a currency system (ChangeCoins - CC) that is awarded to me for doing stuff. From a Rails perspective, what this means, is that we need a data model, persistently stored to the database that tracks something else. Continuing to the Issue Let's look at the issue in question: There are a few notes on the issue here: "Needs to tie back to user_id, metric_id, habit_id" - this indicates foreign key relationships back to other d