ActiveRecord

Database Control in Ruby

Active Record is the preferred method of interacting with a database...

Jun 26, 2014 on Ruby ActiveRecord  1

Nested Resources on Rails

There are a few key things you must remember when working with nested resources in Ruby on Rails. The first thing to do is edit your routes file...

Jul 02, 2014 on Rails Ruby ActiveRecord  0

Three Tables Are Better Than Two

In SQL, you can't have two tables that have each other's foreign key, you must use a third table to hold the foreign keys of the relationship...

Jul 10, 2014 on Rails Ruby ActiveRecord SQL  0

User has_many selfies

When creating a self referential join through another table, you must think of each entry as a new row even if two of the columns have the same number, but...

Jul 16, 2014 on Rails Ruby ActiveRecord  0

You're so vain, you probably think this URL is about you.

In Ruby on Rails, when you want to make a particular route that has a parameter with spaces in it, you would typically get something like /regions/new%20york...

Aug 08, 2014 on Rails Ruby ActiveRecord Prettyurls  0

Nested Comments with Active Record

There are a couple of ways to let your users nest comments with Active Record...

Aug 29, 2014 on Polymorphism ActiveRecord Postgres  0

Raw SQL on Rails

ActiveRecord is fantastic, but sometimes if you are doing complex joins and such, you may need to move away from ActiveRecord and write raw SQL...

Oct 15, 2014 on Rails Ruby ActiveRecord SQL  1

Reduce Your SQL Queries With a Counter Cache

Counter caching is a technique to reduce the number or SQL queries when attempting to call count on a resources' association...

Nov 17, 2014 on Rails Ruby ActiveRecord SQL  0

Advanced Searching With SQL

Over on the left, you see that there is a nice little search box to search through my posts...

Jan 09, 2015 on ActiveRecord SQL  0

Using Transactions with Active Record

<span>A transaction is a database feature where you can create, update, or delete multiple records from a database and if just one of them fails, everything ...

Mar 06, 2015 on ActiveRecord SQL SoftwarePatterns CleanCode MVC  0