Forum: Ruby on Rails record.attribute = nil

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1bac2e65d64faf472cf2ebc94f0f5ee0?d=identicon&s=25 ara.t.howard (Guest)
on 2007-08-02 01:58
(Received via mailing list)
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/
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama
4c3acdc3d93f54cc7a7281780ec8a4ee?d=identicon&s=25 Shai Rosenfeld (shai)
on 2007-08-02 15:05
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/
> --
> 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 / ?
This topic is locked and can not be replied to.