# Disable protected attributes for create or save

**URL:** <https://www.ruby-forum.com/t/disable-protected-attributes-for-create-or-save/152058>\
**Category:** Rails\
**Created:** [October 29, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/disable-protected-attributes-for-create-or-save/152058 "2008-10-29T15:54:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 29, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/disable-protected-attributes-for-create-or-save/152058/1 "2008-10-29T15:54:02Z")

</div>

Hi,

Is there a way to temporarily disable attr\_protected for create and  
save method calls?

Something like save\_without\_protected…

–  
M.

---

<div class="post-metadata">

**Author:** ![arvias](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@arvias](https://www.ruby-forum.com/u/arvias)\
**Post date:** [October 29, 2008, 4:01pm UTC](https://www.ruby-forum.com/t/disable-protected-attributes-for-create-or-save/152058/2 "2008-10-29T16:01:40Z")

</div>

On 29 Oct 2008, at 14:53, Marcelo B. wrote:

> Hi,
> 
> Is there a way to temporarily disable attr\_protected for create and  
> save method calls?
> 
> Something like save\_without\_protected…

The bit to realise is that it’s not save that’s doing the protecting -  
it’s the assigning to attributes.

Something like

foo = SomeObject.new  
foo.send :attributes=, some\_attributes, false  
foo.save

will create a new instance of foo, ignoring protected attributes.

Fred
