# Attr\_readonly

**URL:** <https://www.ruby-forum.com/t/attr-readonly/121829>\
**Category:** Rails\
**Created:** [December 1, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/attr-readonly/121829 "2007-12-01T14:09:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [December 1, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/attr-readonly/121829/1 "2007-12-01T14:09:07Z")

</div>

Hi, i’m using rails 2 pre release 2 (1.99.1).  
In a model (user) i’ve got some attribute set to “attr\_readonly” but  
when i create an object of this model @user =  
User.find\_or\_initialize\_by\_identity\_url(identity\_url) then i save it  
but my readonly attributes are present in my sql query! (so it failed)  
is it a bug or is there a way to change this behaviour?

---

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [December 1, 2007, 4:25pm UTC](https://www.ruby-forum.com/t/attr-readonly/121829/2 "2007-12-01T16:25:43Z")

</div>

it looks like a bug in rails 1.99.1, in this version when you create  
an object with some parameters it will include all table columns. I  
just switch back to 1.99.0 and don’t have any problem.

On Dec 1, 2:08 pm, “Jean-Sébastien” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
