Save only passed fields

12 views
Skip to first unread message

Eric Maicon

unread,
Feb 3, 2014, 8:19:21 AM2/3/14
to activejd...@googlegroups.com
Hello Igor, how are u?

How can i save just the passed fields?

for example: I have a model Called foo with the fields: bar, bar1

I want to do:
update foo set bar = 1;
IF bar ins't empty, and:
update foo set bar = 1, bar1 = 2;
IF bar and bar1 isn't empty.

Do u understand? i'm using save and saveIt, but they are trying to save every field setting they to null.

Igor Polevoy

unread,
Feb 3, 2014, 2:34:37 PM2/3/14
to activejd...@googlegroups.com
Eric, for something like that  you can use Base:
Models on the other hand represent some logical entity and as such retain integrity by reading and saving entire attribute set

tx
Reply all
Reply to author
Forward
0 new messages