# WARNING: Can't mass-assign these protected attributes:

**URL:** <https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934>\
**Category:** Rails\
**Created:** [August 18, 2009, 2:11pm UTC](https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934 "2009-08-18T14:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 18, 2009, 2:11pm UTC](https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934/1 "2009-08-18T14:11:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 18, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934/2 "2009-08-18T14:21:39Z")

</div>

On Aug 18, 1:10 pm, Ritvvij [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 18, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934/3 "2009-08-18T14:55:01Z")

</div>

2009/8/18 Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > 
> 
> 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

---

<div class="post-metadata">

**Author:** ![Ritvvij](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Ritvvij](https://www.ruby-forum.com/u/Ritvvij)\
**Post date:** [August 18, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/warning-cant-mass-assign-these-protected-attributes/173934/4 "2009-08-18T15:28:23Z")

</div>

Ya… I found a few “attr\_accessible”  
Thanks a lot for the help.
