Class names are CamelCase
.
Methods and variables are snake_case
.
Methods with a ?
suffix will return a boolean.
class TodoList < Array | |
def self.load(file) | |
# read the file, create a list, create items, add them to the list, return the list | |
list = TodoList.new | |
File.read(file).each_line do |line| | |
list << line.chomp | |
end | |
list | |
end |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
- Check rails version | |
$ rails -v | |
- To update rails | |
$ gem update rails | |
- Creating a new rails app using postgresql | |
$ mkdir rails_projects | |
$ cd rails_projects | |
$ rails new myapp --database=postgresql |