similar to: Child records needing the ID

Displaying 20 results from an estimated 50000 matches similar to: "Child records needing the ID"

2004 Nov 22
0
Can''t set then read id on AR class in 0.8.5
I''m learning rails and have a test application which parses parts an XML file to create AR objects and puts them in a database. The IDs in the database are taken from the XML, i.e. I explicitly set them using #id. The XML structure is mapped to AR relationships using has_many, belongs_to etc. I''m using a SAX parser, creating objects when the element start tag occurs and saving
2006 Jul 30
1
Insert multiple new child records with the parent
Hello, I am implementing a classic invoice application. On the create new invoice page I want to allow users to add new line items using AJAX: ----------------------------------------------------------------------------- Invoice Date [ ] Client [ ] Line Items 1. [ ] $[ ] <add new line item> <save> <cancel>
2006 Jul 23
2
how to paginate child records
hi i know i can do: @customer_pages, @customers = paginate :customers, :per_page => 8 but these customers have helpdesk calls which are child records. I hoped i could do something like paginate customers.calls, but dat doesn''t work what is the best way to get a paginated list of child records? remco -- Posted via http://www.ruby-forum.com/.
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 Mar 20
1
Running total of a field in child records
What is the best way to get the running total of a number field in child records. Let say I have an Order model, which has_many :line_items, and each LineItem has an amount field. I would like to get the grand total of a specific Order. Is it a good idea to add a ''total'' column in the ''orders'' table and update it every time a line_item is
2015 Aug 24
0
Child thread libR.so
I did some poking around with GDB and confirmed that the advice of setting R_CStackLimit after init, which is echoed in the "threading issues" section of the R-exts help document, isn't entirely useful because init apparently loads the main package which trips over the broken stack checking. Stack trace: #0 R_SignalCStackOverflow (usage=140732197147604) at errors.c:81 #1
2006 Feb 08
1
Adding children via small subform
I''ve read AWDR and especially the part concerning adding child line_items to an order. Unfortunately I want to do my process in reverse and in doing what I thought would work I get a null object error when trying to append the children to the parent. This is a _major_ stumbling block in my Rails use as almost every one of my projects has needed this so its a pretty vital problem I need
2015 Aug 25
0
Child thread libR.so
Simon, Ah, thank you! quiet right. For anyone searching for this in the future, I changed my init fuction to: ---------- SNIP ---------------- void init_r() { SEXP aperm_function; /* this is our version of Rf_initEmbeddedR where we disable stack checking */ const char *init_argv[] = {"MyFront", "--vanilla", "--slave"}; Rf_initialize_R(sizeof
2006 Mar 11
2
assignment of parent ID in child''s fk field
When I create a child record I''m not automagically getting the parent ID put into the fk field. Does object.new take parameters that allows me to do that as part of the AR record creation? Or do I need to do it separately? Or am I missing the boat altogether ;-) Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jan 08
4
ID from child table not handled by AR
Hi all, Im slowly moving forward, but there''s something a miss. I can save some relational records to tables, but only once. For an unknown reason, the primary key (id) of the child table is not automatically increased. (I can only perform one save, (the first records id field holds the value ''0'') and during the next save it says: Mysql::Error: Duplicate entry
2009 Feb 19
3
Associated child records not created on creation of a parent.
I am trying to create a record with association. Within the create method, I would also like to pre-populate dependent (has_many) records from a template in the database. The child records are <u>mysteriously rolled back </u> if I insert them in a loop. If I try to insert a single child record, it works.I have read the books and tried to google my way out of this but am at a dead
2010 May 22
1
Caller ID questions
Hello Folks; I have a dilemma: I have a client with Asterisk 1.4x and he needs to have a record of all incoming calls - caller ID and date/time is sufficient. Since I am not an Asterisk wizard, I am doing it this way. I set a cron job to tailf the last 10 lines of the Master.csv file and package those nicely in an email. However, I can see some inefficiencies in this. Main one is what if
2015 Aug 20
2
Child thread libR.so
So I'm working on a custom front end to R, in one mode of the front end I dynamically load libR.so into a child worker thread. I'm very careful to make sure it is loaded by a single thread and loaded only once, but since it is a child thread it violates assumptions made by the stack size checking inside of R and I get innumerable errors along the lines of Error: C stack usage
2008 Feb 22
1
Ajax.Responders.register: onFailure not working
Hello together. I''ve tried to register an onFailure behavior for all my Ajax.Requests and .Updaters to handle a session-based timout system. On each server request via Ajax there is a check whether the user hasn''t made something for the last x minutes, and if he hasn''t, the php page throws an 403 forbidden header (via header("HTTP/1.1 403 Forbidden")). I am
2006 May 07
4
Paginate() from multiple tables
Hi I''m wondering if there''s a way I can gather data from multiple tables from the child table by using the paginate method? I would have done it using select_by_sql but I need it to paginate. My table structure is: Records is a child of Date and Account Date Account | | ^ ^ Records I want to be able to print a table using the Records controller that will
2006 Apr 26
3
q: master/child where children are added with ajax
Say my user creates an Article and an Article has_many :links. The edit form for article contains an "add link" link_to_remote that brings up an edit line for links for further reading. The problem is that there is that the Article is not yet saved, so it''s unclear how to accumulate or remove these items. I''m sure others have implemented similar things. Hints? Thanks
2006 Apr 26
0
q: master/child with ajax
Say my user creates an Article and an Article has_many :links. The edit form for article contains an "add link" link_to_remote that brings up an edit line for links for further reading. The problem is that there is that the Article is not yet saved, so it''s unclear how to accumulate or remove these items. I''m sure others have implemented similar things. Hints? Thanks
2009 Jul 12
3
RJS render errors when user clicks away before render completes
We have an issue where we are using RJS templates to render the results of Ajax calls. Everything works fine so long as the user waits for the render to occur. However, if the user initiates the request and the RJS template is still in the process of rendering, but hasn''t completed, and the user clicks a different link, then we get a Javascript alert popup "Unexpected Server
2008 Jul 29
0
cannot destroy child records
Hi, i am lost here, i have these models: class Shift < ActiveRecord::Base has_many :transactions,:dependent => :destroy has_one :exchangeproposal class Transaction < ActiveRecord::Base belongs_to :shift has_many :exchangeproposals class Exchangeproposal < ActiveRecord::Base belongs_to :shift belongs_to :transaction with these models i can''t destroy an
2006 Oct 31
0
6364129 need to unmount any child datasets before doing the rollback
Author: lling Repository: /hg/zfs-crypto/gate Revision: 2e20e3394572a9bd1392520e3dc0fff83f57b611 Log message: 6364129 need to unmount any child datasets before doing the rollback 6364126 cannot rollback when a child filesystem is created after a snapshot is taken 6350233 Cannot rename filesystem|volume while it has dependent clones Files: update: usr/src/cmd/zfs/zfs_main.c update: