search for: exclusively_dependent

Displaying 8 results from an estimated 8 matches for "exclusively_dependent".

2006 Feb 15
0
Acts_as_taggable and exclusively_dependent?
How do you guarantee deletion of tags when deleting the parent of a tagged object? Example: Template ->> Message ->> Tags When Message is destroyed the Tags are also. When destroying the Template, the Message is destroyed, but Tags are not. Any tips? -- Posted via http://www.ruby-forum.com/.
2006 Jul 24
3
HowTo?: Eager caching of third order ActiveRecord assoc.
...t;LEFT OUTER JOIN" SQL clauses with the needed conditions, to fetch little-little-children data, but how to do this with ActiveRecord and its cache? My models are as follow: # Model Software # ----------------------------- class Software < ActiveRecord::Base has_many :releases, :exclusively_dependent => true end # Model Release # ----------------------------- class Release < ActiveRecord::Base belongs_to :software has_many :acquisitions, :exclusively_dependent => true end # Model Acquisition # ----------------------------- class Acquisition < ActiveRecord::...
2006 Jun 02
0
Problem updating child row from parent model
...erTest> [test/unit/order_test.rb:25]: <4> expected but was <2>. I tried lots of different things, but I always get that error. I really don''t know why. Here''s the declaration of my model order.rb class Order < ActiveRecord::Base has_many :line_items, :exclusively_dependent => true end Here''s the declaration of my model line_item.rb class LineItem < ActiveRecord::Base belongs_to :order end And I put at the begining of the order_test.rb file. fixtures :orders, :line_items I guess I''m doing wrong, maybe it''s not the way...
2006 Jun 22
1
Active Record question, orphaned children
I have a Deck object and a Card object with their corresponding tables. (You know a deck of cards.) When I destory a Deck it leaves orphaned cards in the database. Is there a way to set up the objects with ActiveRecord so that when a parent object is destoryed the child objects are destroyed as well? My code below. class Deck < ActiveRecord::Base has_many :cards end class Card <
2006 Apr 20
0
acts_as_list not CASCADE''ing in singular n-tier model structure
[using RAILs 1.1.2] Has anyone else seen issues where multiple tiered "acts_as_list" models do not CASCADE delete correctly? For instance, I have 4 models, the first 3 in the hierarchy have the appropriate "have_many" declarations with "exclusively_dependent => true". The last the models have the appropriate "acts_as_list" with the correct scope and "belong_to" declarations. If I did not have PostgreSQL setup to CASCADE the FK constraints, deleting a model object on the 2nd tier would not go down to the 4th. Does &q...
2005 Sep 07
0
model constructor errors.
...oto].each_pair do |id, parameters| photo = Photo.new(parameters) end class Photo < ActiveRecord::Base attr_accessor :file, :content_type, :size, :extension, :local_path, :destroyed attr_reader :original_filename attr_accessible :title, :description has_many :comments, :exclusively_dependent => true belongs_to :user validates_presence_of :title validates_presence_of :description, :on => :update acts_as_taggable def picture=(picture_field) logger.debug "in picture method" ## DEBUGGING @local_path = picture_field.local_path @filename = base_par...
2006 Mar 27
1
Tests not tiding up after themselves?
...the tests on the fixtures used for that test case only, but because the previous test left the database dirty there are foreign key constraints when doing this. The headline test should clean all the three tables, but it tries to clean only those it knows about. I have tried to use :dependent and :exclusively_dependent on the article-change relationship, but it didn''t help. For the sake of completeness, I am using MySQL 4.1. Should I be doing anything differently? Do I have to use all three fixtures on all my test cases? Cheers, Thiago Arrais
2006 Jul 15
12
Safe way to destroy records
Hello, how can I check if a destroy was successful? Is the object only frozen if deleted or do I have to do an additional find to see if there is a record left? What happens if an after_destroy callback returns false? Is there always a rollback? Markus