Hi, Suddenly all the attributes in all my models have become protected and I cannot save anything. Of course a solution is to add attr_accessor for all the atttributes in all the models. But this was not the case before. All attributes were public. Any idea how suddenly all attributes becomes protected? Any idea how I can make all attributes public again? Please advise
Frederick Cheung
2009-Aug-18 12:20 UTC
Re: WARNING: Can''t mass-assign these protected attributes:
On Aug 18, 1:10 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Suddenly all the attributes in all my models have become protected and > I cannot save anything. Of course a solution is to add attr_accessor > for all the atttributes in all the models. But this was not the case > before. All attributes were public. >Someone, somewhere is calling attr_protected/attr_accessible on your model ( a plugin could in theory do this for example) Fred> Any idea how suddenly all attributes becomes protected? > Any idea how I can make all attributes public again? > > Please advise
Colin Law
2009-Aug-18 12:53 UTC
Re: WARNING: Can''t mass-assign these protected attributes:
2009/8/18 Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > > On Aug 18, 1:10 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi, >> >> Suddenly all the attributes in all my models have become protected and >> I cannot save anything. Of course a solution is to add attr_accessor >> for all the atttributes in all the models. But this was not the case >> before. All attributes were public. >> > Someone, somewhere is calling attr_protected/attr_accessible on your > model ( a plugin could in theory do this for example) > > Fred > >> Any idea how suddenly all attributes becomes protected? >> Any idea how I can make all attributes public again?Revert to previous versions using your version control system (hopefully you are using one, git is my favourite) to find out when the problem was introduced. If you are not using a VCS then now you know why you should :) Colin
Ya... I found a few "attr_accessible" Thanks a lot for the help. On Aug 18, 7:53 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/18 Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > On Aug 18, 1:10 pm, Ritvvij <ritvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hi, > > >> Suddenly all the attributes in all my models have become protected and > >> I cannot save anything. Of course a solution is to add attr_accessor > >> for all the atttributes in all the models. But this was not the case > >> before. All attributes were public. > > > Someone, somewhere is calling attr_protected/attr_accessible on your > > model ( a plugin could in theory do this for example) > > > Fred > > >> Any idea how suddenly all attributes becomes protected? > >> Any idea how I can make all attributes public again? > > Revert to previous versions using your version control system > (hopefully you are using one, git is my favourite) to find out when > the problem was introduced. If you are not using a VCS then now you > know why you should :) > > Colin