[Nitro] [Og] expected behaviour?
pedro.gutierrez at netcourrier.com
Fri Feb 16 05:39:39 EST 2007
Ok, I was just wondering what is the expected behaviour. Maybe that's
not a bug, as Og offers transparent persistence.
However, I will try to remove og/relation/refers_to.rb:65 from my
local copy of og, and see what happens.
Thanks for the clue, and congratulations for such a nice job you guys
are doing with nitro and og!
Le Feb 15, 2007 à 5:45 PM, Jonathan Buch a écrit :
> Weclome Predro!
>> a Topic contains many Sections
>> a Section belongs to a Topic
>> That's all. Now, I create (and save) a "topic1", then I create (and
>> save) a "section" attached to "topic1". Everything is fine so far.
>> Then I create a second topic, named topic2, and save it.
>> Then I try to move section from topic1 to topic2, by doing:
>> section.topic = topic1.
>> Immediately, Og issues an UPDATE sql statement in the form:
>> UPDATE ogsection SET name='update issue', topic_oid=2 WHERE oid=1
>> The thing is that this statement has been executed BEFORE I call the
>> save method on the section!
>> Is that the expected behaviour? I was expecting that the changes
>> where performed in memory, and then commited to the database when I
>> do "section.save"
> This looks like a bug in the code:
> og/relation/refers_to.rb:65: save unless self.unsaved?
> So, save when the current object is already saved. I'm not getting
> the all implications yet of removing that line, but it shouldn't
> hurt much.
> Og.setting :autosave_relations, :default => false ?
> Or does that look like overload... :P George?
> Feel the love
> Nitro-general mailing list
> Nitro-general at rubyforge.org
More information about the Nitro-general