Browse files

Update extending-active-record.md

  • Loading branch information...
1 parent bc9f074 commit 592dd8975146a62e0c396e3e85df100c887f1e76 @radar committed Feb 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 extending-active-record.md
View
2 extending-active-record.md
@@ -110,7 +110,7 @@ Ah, now it can't find the `by_year` method, so now we get to the extending part.
To add these methods to Active Record, we'll use the `extend` method which will add methods from the module to the class, there by *extending* it. Get it? Good. At the bottom of `lib/by_star.rb` we'll add this line:
- ActiveRecord::Base.extend ByStar
+ ActiveRecord::Base.send :extend, ByStar
Now we just need to define the `by_year` method inside the `ByStar` module now. This method should return all objects that are in the given year. For now, we'll just get it to do objects in the current year. Let's define the `by_year` method in the module now:

0 comments on commit 592dd89

Please sign in to comment.