Missing ActiveRecord methods (find_by) for object
<p>I am trying to do an assignment which requires me to create and save an ActiveRecord within my Model class, and then return it.  The rspec is expecting to use the find_by method to verify this.  Here's my Model:</p>

<h1>-----------------------</h1>

<pre><code>class User &lt; ActiveRecord::Base
attr_accessor :id, :username, :password_digest, :created_at, :updated_at
after_initialize :add_user

def initialize(attributes={})
    @username = attributes[:username]
    @password_digest = attributes[:password_digest]
    super
end

def add_user
    self[:username] = @username
    self[:password_digest] = @password_digest
    self.save
    self[:id] = self.id
end
end
</code></pre>

<h1>----------------</h1>

<p>If I do User.new(params), the record is in fact stored properly to the DB.  But, the find_by method is missing for the returned object.  So, rspec fails.  I have looked everywhere but can't seem to find the solution.  I am a noob, so sorry if the answer is obvious and I can't see it.</p>