On Tue, Aug 9, 2011 at 11:08 AM, Sayuj Othayoth <[email protected]>wrote:
> > > On Mon, Aug 8, 2011 at 5:54 PM, Colin Law <[email protected]> wrote: > >> On 8 August 2011 12:34, Sayuj Othayoth <[email protected]> wrote: >> > >> > >> > On Mon, Aug 8, 2011 at 4:42 PM, Colin Law <[email protected]> >> wrote: >> >> >> >> On 8 August 2011 11:40, Sayuj Othayoth <[email protected]> >> wrote: >> >> > >> >> > >> >> > On Mon, Aug 8, 2011 at 4:06 PM, Colin Law <[email protected]> >> >> > wrote: >> >> >> >> >> >> On 8 August 2011 11:17, Sayuj Othayoth <[email protected]> >> 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* Thank you Colin. > > 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 [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

