> 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
was that Post actually actionmailer class?
saw ur exception coming from action mailer ?
i cannot check now, only hv my mobile with me.
There isn't any private or protected modifier in my class. How can I know if something is monkeypatching my class?
thx for reply :D
--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.