On Thu, Feb 23, 2012 at 17:41, Bruno Meira <[email protected]> wrote:
> My application suddenly started to give this message. > NoMethodError: private method `new' called for Post.class > > my post class has: > class Post < ActiveRecord::Base > belongs_to :user > ... > end The problem is probably somewhere in the "..." part! Sounds to me like you decided to add a private method, above initialize, and forgot to go back to public. That's why I usually leave the private stuff for last. (That, and the public stuff is more important when someone's reading the code.) Or are there no private items in there? Are you *sure*? Use your text editor to search for the word private. Then do protected too, just in case. Is there some chance something is monkeypatching your Post class and replacing "new" with a private version? -Dave -- Dave Aronson: Available Cleared Ruby on Rails Freelancer (NoVa/DC/Remote) -- see www.DaveAronson.com, and blogs at www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com -- 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.

