• Online, Self-Paced
Course Description

This course covers how to work with databases in Ruby on Rails. It covers data models, referential integrity, record validation, and optimistic and pessimistic locking.

Learning Objectives

Basic CRUD and Data Models

  • start the course
  • create and use a basic CRUD in Ruby on Rails
  • create various data models in a Ruby on Rails database
  • implement one-one relationships between two ActiveRecord models
  • link one database in Ruby on Rails to multiple other tables using a has_many relationship
  • use the joins keyword or the includes keyword to query two Ruby on Rails databases that have a has_many relationship
  • up a polymorphic association in Active Record by generating models, declaring the association, and modifying the migrate

Referential Integrity

  • examine a foreign key for an has_many relationship association in Ruby on Rails
  • manage foreign keys in Ruby on Rails databases
  • ensure referential integrity in Ruby on Rails databases

Duplicate Data

  • identify the three main reasons duplicate data might be added to a Ruby on Rails database
  • resolve duplication in a Ruby on Rails database by writing a validation rule in the model, as well as by adding an index to the database
  • recap on how avoid duplication in Ruby on Rails databases and use the Consistency Fail gem

Active Record - Validating Records

  • add validation rules to the ActiveRecord in a Ruby on Rails database
  • handle invalid data in a Ruby on Rails database
  • migrate a not_null database in Ruby on Rails
  • outline the difference between an empty string and a nil value in Ruby on Rails

Optimistic Locking

  • overview how to implement optimistic locking in a Rails application
  • implement optimistic locking in a Rails application
  • use the internal counter with Optimistic Locking in Ruby on Rails
  • review the implementation of optimistic locking in a Rails application

Pessimistic Locking

  • overview pessimistic locking and the different types of pessimistic locks you can have in Ruby on Rails
  • implement optimistic locking in a Rails application
  • review the implementation of pessimistic locking in a Rails application

Practice: Work with Databases in Ruby on Rails

  • make decisions involving basic database concepts in a Ruby on Rails application

Framework Connections

The materials within this course focus on the Knowledge Skills and Abilities (KSAs) identified within the Specialty Areas listed below. Click to view Specialty Area details within the interactive National Cybersecurity Workforce Framework.