Home > Announcements > Additional Standalone ActiveRecord Example

Additional Standalone ActiveRecord Example

In the Sunday section, we re-created the previous example application using ActiveRecord. This is very similar to the examples from Lecture 6 in the download section, except that this was written with an emphasis on test driven development.

It includes examples of:

  • Migrations
  • Simple Seed Data
  • Fancy Finders
  • Validations and Validation Testing
  • One to Many Relationships

For the sake of time, there were no many to many relationships. Examples of m2m can be found in the download section.

Use rake -T to view the rake tasks. Use “rake db:migrate” to run the migrations, and “rake test” to run the tests.

Run “ruby section.rb” to run the demo code. Modify section.rb to play around with the finished results.

You can click here to download the complete source code.

Categories: Announcements Tags:
  1. No comments yet.
  1. No trackbacks yet.