title: Cannot access attr_accessor defined variables
body: <p>I am using Thinking Sphinx to run searches and I get the appropriate ActiveRecord Models fine. The problem is, I want to create an appropriate link path and text on each model, then send the info to the browser in the form of JSON, via AJAX. I am using the following to build those link attributes:  </p>
  
  <p>In the controller:
  <code> <pre>
  class FindController &lt; ApplicationController
    def tag_results
      @results = ThinkingSphinx.search(params[:terms])
      @results.each do |result|
        result.build_ajax_response
      end
      respond_to do |format|
        format.html
        format.json { render :json => @results }
      end
    end
  end
  </pre></code>
  In the model:
  <code> <pre>
  class TaggedItem &lt; ActiveRecord::Base
    attr_accessible :name
    attr_accessor :search_link, :search_text</p>
  
  <p>def build_ajax_response
      self.search_link = Rails.application.routes.url_helpers.tagged_item_path(self.id)
      self.search_text = self.name
    end
  end
  </pre> </code>
  The resulting json object doesn't have either of the search_* attributes listed, much less have a value for them. I've tried using @search_link as well as just search_link in the <code>build_ajax_response</code> method.</p>
  
  <p>Am I doing this wrong? Could there be something else interfering?</p>