Everyday Active Record Episode 2: Finding and Scoping Models

Posted in Development, Frameworks, Databases on July 10, 2008


Everyday Active Record Episode 2: Finding and Scoping Models

We’ll pick up where we left off by fetching models using the find method with several options, including the new Rails 2.1 named_scope method. You’ll learn how to:

  • perform finds on models using various find options
  • write class methods to encapsulate complex find operations
  • use the new Rails 2.1 named_scope method to elegantly constrain queries and make controllers easier to read
  • perform calculations using the built-in calculation methods
  • use more advanced find options such as :include

Watch Video

Tags: Ruby, Ruby On Rails, Frameworks, Databases, ActiveRecord, ORM, The Pragmatic Programmers, Everyday Active Record