On 9 August 2011 07:00, Sayuj Othayoth <sayujothay...@gmail.com> wrote: > > > On Tue, Aug 9, 2011 at 11:08 AM, Sayuj Othayoth <sayujothay...@gmail.com> > wrote: >> >> >> On Mon, Aug 8, 2011 at 5:54 PM, Colin Law <clan...@googlemail.com> wrote: >>> >>> On 8 August 2011 12:34, Sayuj Othayoth <sayujothay...@gmail.com> wrote: >>> > >>> > >>> > On Mon, Aug 8, 2011 at 4:42 PM, Colin Law <clan...@googlemail.com> >>> > wrote: >>> >> >>> >> On 8 August 2011 11:40, Sayuj Othayoth <sayujothay...@gmail.com> >>> >> wrote: >>> >> > >>> >> > >>> >> > On Mon, Aug 8, 2011 at 4:06 PM, Colin Law <clan...@googlemail.com> >>> >> > wrote: >>> >> >> >>> >> >> On 8 August 2011 11:17, Sayuj Othayoth <sayujothay...@gmail.com> >>> >> >> wrote: >>> >> >> > [...] >>> >> >> > class StatusMessage < ActiveRecord::Base >>> >> >> > belongs_to :users >>> >> >> >>> >> >> That should be :user, singular. >>> >> >>> >> Did you make this correction as I suggested previously, so it should >>> >> be belongs_to :user (each message belongs to one user so singular) >>> >> >>> >> Colin >>> > >>> > >>> > Yes I made the changes. >>> > Error is "undefined method `user' for #<StatusMessage:0xb126384>" >>> >>> >Could you post the code for the StatusMessage class again please? >>> >> class StatusMessage < ActiveRecord::Base >> belongs_to :users >> default_scope :order => "created_at DESC" >> end >> > > I should use belongs_to :user instead of belongs_to :users
In my initial post I pointed out two errors. That was one of them. Then later I queried whether you had made that correction and you said you had. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.