Displaying 20 results from an estimated 2000 matches similar to: "#5209 patch: :dependent => :nullify deletes child records"
2007 Jun 25
1
has_many with :dependent => :nullify
Hi all,
There is something confusing with has_many in the current API :
When deleting a record with association.delete, the corresponding
association''s foreign key is nullified. However, if has_many has
the :dependent option set (to any value), the association''s destroy
method is called instead.
This is awfully inconsistent with the behavior expected when
setting :dependent to
2006 Apr 15
1
Is this a HAS_ONE bug?
Let''s say I have:
A BELONGS_TO B
B HAS_ONE A (with :dependent=>:nullify)
But this association does not need to exist. In other words, I could
have many A''s and B''s that are not associated in this manner.
Presently, if I try to delete "B":
1. If B is associated to an "A", this works fine and A.my_B is
nullified.
2. If B is NOT associated, I
2006 Jul 10
0
Dependent nullify doesn''t use save?
If you have a model that has
has_many :clients, :dependent => :nullify
Will that run the save method for each client or will it just simply
nullify the foreign key using straight SQL without every calling
save. Because I have some very important before_save code in my
Client model and I do not think it is getting ran.
Thanks for your help.
Thank You,
Ben Johnson
E:
2010 Sep 16
1
[RFC] function to parse string to argc/argv pair
Currently, I'm looking to improve rosh and would like to start using
getopt(). I'd like to parse a string obtained by fgets() to be like
the argc/argv pair created by __parse_argv but in a way that's more
cross-platform (such that it can also be used by .lnx files rather
than just COM32) and suitable to use in rosh and lua.c32.
I've made a function and inlined a test program for
2011 Apr 06
2
Wish List: has_many :dependent => {}
I am after a nice way to disable (not destroy, delete nor nullify) all
associated records. I''m a hoarder, I don''t want to get rid of anything but I
want to stop records being visible.
I have a disabled boolean in my tables and if I disable the top record in
the association (say the association is 5-6 levels deep), I would like to
cleanly disable its children.
I''ve
2013 Apr 20
8
xen-unstable: commit commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c leaves HVM guest dangling after shutdown or destroy.
Hi,
Commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests
Leaves HVM guests dangling after shutdown or destroy:
xl list gives:
(null) 16 0 4 --p--d 11.5
(null) 17 0 1 --ps-d 12.0
(first was destroyed, second shutdown)
The
2007 Jul 17
5
habtm confusion
Hello friends!
I am trying to make a database that will have a group of people set to
committees, and a person can be in multiple committees, and a committee
obviously has multiple people. The people are senators at my
university. These are my current models:
senator.rb:
--
class Senator < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :floor
has_and_belongs_to_many
2003 Dec 19
5
for loop over dataframe without indices
One can perform a for loop without indices over the columns
of a dataframe like this:
for( v in df ) ... some statements involving v ...
Is there some way to do this for rows other than using indices:
for( i in 1:nrow(df) ) ... some statements involving df[i,] ...
If the dataframe had only numeric entries I could transpose it
and then do it over columns but what about the general case?
2016 Mar 27
2
Undefined behaviour in command line parser
In these days I’ve integrated llc code into my compiler.
I had an undefined behaviour because when cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion) is called, the modules I give to the code in input to compile got somehow “corrupted" by this function.
It is definitely an undefined behaviour because every debug I do, modules gets different changes, producing
2009 May 12
1
bug in com32/modules/chain.c
Hello,
The main function in com32/modules/chain.c does a lot of argument
parsing, finding the drivename, partition, seg, etc., for two statements
nullifying most of the work:
drivename = argv[1];
partition = argv[2]; /* Possibly null */
Seeing as the function initializes the variables correctly at the
beginning:
drivename = "boot";
partition = NULL;
shouldn't these
2003 Aug 01
1
[Fwd: dvd+rw-format -force problem]
> -------- Original Message --------
> Subject: dvd+rw-format -force problem
> Date: Thu, 31 Jul 2003 21:30:00 +0200
> From: Melvyn Sopacua <freebsd-stable@webteckies.org>
> Organization: WebTeckies.org
> To: stable@freebsd.org
>
> I haven't felt the need to fully blank a DVD+RW for a while untill today.
Formally speaking blanking is not appicable to DVD+RW.
2006 Jul 24
1
[PATCH] vfork() for parisc
Implement "pid_t vfork(void)" for parisc.
Signed-off-by: Kyle McMartin <kyle at parisc-linux.org>
---
Ugh. vfork() me harder.
Kbuild | 2 +-
vfork.S | 31 +++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/usr/klibc/arch/parisc/Kbuild b/usr/klibc/arch/parisc/Kbuild
index d57a873..57ca5c2 100644
--- a/usr/klibc/arch/parisc/Kbuild
2007 Dec 30
4
:dependent for not destroying
Hi,
Is there a way to use the :dependent option to set a certain attribute
to null rather than destroying the records?
For example, take the following models:
User
id, integer
name, string
group_id, integer
belongs_to :democrats
Groups
id, integer
name, string
has_many :users
If I delete a certain group, is there a way to have the ''group_id''
attribute of all the
2016 Mar 27
0
Undefined behaviour in command line parser
Hi Lorenzo,
Thanks for the report. Can you create a new entry in Bugzilla? With
steps to reproduce (command line options, etc) and how you're getting
the value of the triple (debugger?).
http://llvm.org/bugs/
cheers,
--renato
On 27 March 2016 at 17:15, Lorenzo Laneve via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> In these days I’ve integrated llc code into my compiler.
>
2006 Jul 25
8
Creating records in two models in a RESTful way.
Hey everyone,
I have a philosophical question here. Say I have a website that uses two
models for accounts: Person and Company. Normally I would just have
/accounts/new for user signup.
However, the RESTful way to do it is to have /people and /companies.
Unfortunately, this doesn''t account for a situation where you''d have a
one-page signup form. I wouldn''t want
2011 Jan 12
3
ubuntu doesn't daemonize smbd
OK, not exactly a samba issue but maybe the Ubuntu maintainer reads
this list and can provide some input.
Problem: Ubuntu doesn't daemonize smbd.
System: Ubuntu Lucid where a recent update moved many startup scripts
into the "upstart" system.
Now smbd is started and runs as "smbd -F". If I edit the upstart
script (/etc/init/smbd.conf) so that it runs as "smbd
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action,
for example an .rhtml and a .rjs file to handle the view for the same
action?
I suspect not, but this makes me wonder if there a way to call the .rjs
file from within the .rhtml so the statements within it get executed?
Thanks,
Andy
2006 Jul 19
0
Clearing dependent collections
I have a user model that owns messages :
class User < ActiveRecord::Base
has_many :messages , :dependent => :nullify
end
I''m using nullify so that when the user is deleted, the messages
continue to exist - they''re just marked as being ownerless.
However, calling user.messages.clear actually deletes all his
messages, which I was a little surprised at. I would
2005 Dec 18
1
Samba 3: "restrict anonymous = 2" breaks domain joining
Hello,
Despite not having received any input on my last problem, I managed to
work it out and now I've finally got a working Linux PDC with ldapsam
and non-root domain admin. As it turned out, the problems were caused
by a combination of Samba settings, too tight security on Windows boxes
and, in case of XP x64, a need for some patches against Samba source
code; here I would like to ask a
2016 Mar 16
2
static vs shared modules build
>> what other behavior do you expect?
>> how would you remove "acl_xattr" from global for a share otherwise?
Well, I wouldn't declare it in [global] then :-)
>> global: this is what has to be active everywhere until i say other
>> share: i now say other and i say it *fully*
>> any other behavior in the past by mixing half of [global] and add [share]