Report abuse

console


			
lovebucket@lovebucket-laptop:~/apps/stat$ script/console
Loading development environment (Rails 2.1.2)
>> u = User.find(1)
=> #
>> u.avatars.build
NoMethodError: undefined method `avatars' for #
  from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:256:in `method_missing'
  from (irb):2
>>

user.rb


			
class User < ActiveRecord::Base
  include Authentication
  include Authentication::ByPassword
  include Authentication::ByCookieToken

  # Associations
  has_one :location
  has_one :avatar
  has_one :personal

avatar.rb


			
class Avatar < ActiveRecord::Base

  # Associations
  belongs_to :user