# Record.attribute = nil

**URL:** <https://www.ruby-forum.com/t/record-attribute-nil/111034>\
**Category:** Rails\
**Created:** [August 2, 2007, 1:58am UTC](https://www.ruby-forum.com/t/record-attribute-nil/111034 "2007-08-02T01:58:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [August 2, 2007, 1:58am UTC](https://www.ruby-forum.com/t/record-attribute-nil/111034/1 "2007-08-02T01:58:40Z")

</div>

am i missing something obvious about ar, or is there no clear way to  
do this:

record.attribute = nil

or equivalent to set an attribute to ‘NULL’ ??

thanks.

## a @ [http://drawohara.com/](http://drawohara.com/)

we can deny everything, except that we have the possibility of being  
better. simply reflect on that.  
h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [August 2, 2007, 3:05pm UTC](https://www.ruby-forum.com/t/record-attribute-nil/111034/2 "2007-08-02T15:05:35Z")

</div>

ara.t.howard wrote:

> am i missing something obvious about ar, or is there no clear way to  
> do this:
> 
> record.attribute = nil
> 
> or equivalent to set an attribute to ‘NULL’ ??
> 
> thanks.
> 
> ## a @ [http://drawohara.com/](http://drawohara.com/)
> 
> we can deny everything, except that we have the possibility of being  
> better. simply reflect on that.  
> h.h. the 14th dalai lama

how is the record.column defined? (if it is defined as ‘not null’ then  
presumably, you won’t be able to define the attribute as null/nil)

how did you create the db-table? via rake / migrations / sql hand  
creation / ?
