Everyday Active Record Screencast, Episode 1 -- NoMethodError Issue
Karen Labenz
2 posts
|
I have been following along with no problems until I type:
NoMethodError: undefined method `first' for #<Class:0x1872b9c>
from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in `method_missing'
from (irb):15
development log output: None of the console commands in the screencast work after this… Running OSX 10.5.2 I would appreciate any help—thanks! |
Ryan Bates
25 posts
|
Hi Karen, the “first” method is new in Rails 2.1 (which will be released very soon). In the meantime you can use “find(:first)” instead which basically does the same thing. Sorry I should have mentioned this in the episode. |
Karen Labenz
2 posts
|
That did the trick—thanks so much! |
Bala Paranj
6 posts
|
Ryan, where is the current_date method defined? |
Ryan Bates
25 posts
|
current_date isn’t a method. It’s part of ANSI SQL, so it is available in most database engines. |
5 posts, 3 voices
