Displaying 20 results from an estimated 4000 matches similar to: ":dependent for not destroying"
2006 Jun 07
3
#5209 patch: :dependent => :nullify deletes child records
Hi everyone,
A couple of weeks ago I noticed a bug with :dependent => :nullify on
a has_many or has_one. When you delete the parent, the children''s
foreign keys are nullified, as expected. But when you do
parent.child.delete or parent.children.clear, ActiveRecord actually
deletes the child records, rather than just nullifying them.
In my eyes, if you''ve set
2006 Jan 30
5
Problems migrating from Postgres to MySQL
Hello everyone,
I''m trying to migrate a working app from Postgres to MySQL, and I''m
trying to use a migration to get it done rather than alter all my
database table creation scripts to MySQL syntax. I''ve done loads of
work with Postgres, but am a real newbie with MySQL...
I did a ''rake db_schema_dump'' from my Postgres app, and got a nice
looking
2006 May 19
7
How can I set up relations for these models?
Hello!
I have a legacy DB and want to use ActiveRecord for it.
However, I can''t set up a relation correctly.
Here''s table spec:
[products]
id
name
price
[subproducts]
product_id
subproduct_id
Some example data:
[products]
1, "Computer", 500.00
2, "Monitor", 200.00
3, "Printer", 100.00
4, "System", 700.00
5, "System2",
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
2007 Sep 08
5
update_va_mapping_otherdomain
Greetings,
I have a technical question about update_va_mapping_otherdomain.......
I have two components: a C program linked against libxc
and a kernel module which performs the following simple
sequence of events from domain zero:
1. Pause guest (unprivileged)
2. Grabs the PTE associated with a random (but present) page
within the guest''s kernel''s address space
(using a
2011 Mar 07
1
has_one :dependent => :destroy error (in `configure_dependency_for_has_one': compile error (SyntaxError))
Hi I''m getting the following error :
/Users/nikosd/.rvm/rubies/ree-1.8.7-2011.02/bin/ruby -e
$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
/Users/nikosd/.rvm/gems/ree-1.8.7-2011.02@.../bin/rake test
Testing started at 12:00 PM ...
(in /Users/nikosd/Work/.../.../...)
2006 Apr 26
2
Ruby On Rails Salary in the UK? how much?
Hi,
What do you think is a reasonable salary for a ROR programmer in
Manchester, UK?
If you''re working with ROR and in the UK i''d be interested in knowing
your salary :-)
Your opinions would be very valuable to me
JD
--
Posted via http://www.ruby-forum.com/.
2006 Nov 29
4
how do I model self-referential entities?
Hi all -
I am having some trouble figuring out how to model self-referential
entities in Rails.
I have a "group" model, which can have 0 or more "group" objects or 0 or
more "user" objects.
I tried creating a subgroup table that has a parent_group_id and a
child_group_id as foreign keys but can''t figure out how to create the
mapping in my ruby model
2008 Jul 04
2
How do change catalog before catalog is delted?
In my rails application,there are two models:post and catalog.
One post has a catalog,and one catalog has many posts.
When I delete a catalog,the posts belongs to the catalog will not be
shown normal,for it''s catalog is no existed.
Now I want to create(if the ''Defalut catalog'' is not existed) a
''Defalut catalog'' in catalogs table,and make the
2012 Oct 22
4
[LLVMdev] Self-referential instruction from jump threading
Hello,
After investigating PR14133, I've discovered that jump threading can output self-referential instructions:
%inc.us = add nsw i32 %inc.us, 1
At least in the test case for that bug report, the relevant code is later deleted (perhaps it is unreachable), and so this does not cause a problem. Unfortunately, when vectorization is enabled, this instruction causes BBVectorize to hang. Should
2006 Aug 02
2
Self-Referential has_many :through
Hello all.
I am trying to create a self-referential has_many :through. I used the
following site as a guide
http://blog.hasmanythrough.com/articles/2006/04/21/self-referential-through
but it still doesn''t appear to be working. I have two models. Person and
Relationship. A person has many contacts (Which is another person)
through relationships
class Person < ActiveRecord::Base
2009 Apr 08
3
order transfers by file size
Is it possible to have rsync order transfers by file size (smallest
files first) ?
Would it be a big patch ?
Thanks
Viki
2006 Aug 13
10
does rails enforce referential integrity???
Hi,
Is rails supposed to support referential integrity? That is rails
either support to be able to ensure that when a new contact is created
this can only happen if a valid suberb is associated with it, and which
mechanisms of the below are supposed to do this?
(a) using DB foreign key constraints information as a basis?
(b) using the "has_one" line in the model file to enfore?
If
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential
habtm-like Association using the funky new :through stuff. This is
about users having friends, so here''s my user.rb:
class User < ActiveRecord::Base
has_many :friendships, :foreign_key => ''user_id''
has_many :friends, :through => :friendships, :source => :friend
end
And here''s
2010 Jul 11
10
dependent support for has_many through?
Given the following
class Programmer < ActiveRecord::Base
has_many :assignments
has_many :projects, :through => :assignments
end
if I call Programmer#projects.clear, it will delete_all the joining
assignments; however, I have a situation where I''d like the
assignments to get destroyed instead so that their after_destroy
callbacks get called. It would be simple 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 Aug 15
2
How to access attribute in a self-referential many-to-many relationship
Hello List,
I created a self-referential many-to-many relationship (as described
in the book Rails recipe #18), where I have a model that has
many-to-many relationships with itself. In this case, it''s person who
can become friends. The join table looks like this:
mysql> select * from friends_people;
+-----------+-----------+-----------+
| person_id | friend_id | confirmed |
2015 Feb 24
6
[LLVMdev] Jump Theading/GVN bug - moving discussion to llvm-dev
----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Katya Romanova" <Katya_Romanova at playstation.sony.com>, "Nick Lewycky" <nlewycky at google.com>
> Cc: llvmdev at cs.uiuc.edu, "Philip Reames" <listmail at philipreames.com>, "Hal Finkel" <hfinkel at anl.gov>,
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
2007 May 29
22
Rails doesn't scale because RI/transactions in app not db!!!
Not that I have your attention! :P I''ve been having a discussion with a
respected colleague here:
http://phpbuilder.com/board/showthread.php?t=10340411 (Rails vs. PHP)
He''s basically saying that Rails won''t be able to scale because
referential integrity and tranactions are done in the application rather
than the database. Please read the referenced thread for much more