[Rails] Re: Rails3-beta4: Calling to_json on an ActiveRecord::Relation causes an error

2010-08-04 Thread wprater
=> @top.to_a.as_json(:only => [:id, :title ] ) } > > Hope this helps. > > Huet > > On Aug 3, 8:01 am, Conrad Taylor wrote: > > > > > On Mon, Aug 2, 2010 at 2:26 PM, wprater wrote: > > > Here is my model and an attempt to convert to json.  Whether there i

[Rails] Rails3-beta4: Calling to_json on an ActiveRecord::Relation causes an error

2010-08-02 Thread wprater
iod.where('end_date < ?', Time.now) => [] ruby-1.8.7-p249 > PayPeriod.where('end_date < ?', Time.now).to_json ActiveSupport::JSON::Encoding::CircularReferenceError: object references itself from /Users/wprater/.rvm/gems/ruby-1.8.7-p249/gems/ activesupport-3.0.0.