similar to: Parent Child - Transaction Issue

Displaying 20 results from an estimated 11000 matches similar to: "Parent Child - Transaction Issue"

2007 Apr 26
8
Win32 service - Errno::EINVAL (Invalid argument) when uploading image file
Hi guys, I''m facing an error trying to run my app as mongrel_service, hope those who have faced similar issue can help to shed some lights. The app was fine when running from console, but when running it as a service, it failed when I try to upload ''image file'', it has no issue uploading other types of files. Environment: ------------ mongrel (1.0.1, 0.3.13.3)
2008 Apr 30
6
best practice for object transaction?
I have a new @offer that needs to generate a document if saved. But that''s all or nothing: transaction do @offer.save! generate_document end # handle exceptions if needed If save! fails everything is fine, but if generate_document raises an exception @offer is left as a model with timestamps, id, which is not a new_record? anymore (though the database was
2006 Oct 13
3
Validation errors in has_one/belongs_to relationships.
I have two objects, QuoteInput and Insured. QuoteInput has one Insured and Insured belongs to QuoteInput. I don''t understand what I''m seeing. I assign an Insured to a QuoteInput. The Insured object has invalid data. I call save! on the quote input. QuoteInput has no validations. I expect two things to happen - 1) an exception should be thrown, indicating that there was a
2006 Jan 31
2
How can I overwrite the parent.children.push(child) Method?
Hi all I want to overwrite the push method (which is an alias of <<, the same as concat) of collections, and there I want to test if :uniq is set to true in the relationship. If so, the method should check if the passed object is already related to the parent, or not (only then it will be added). But I just can''t find the original code of this method, so I could overwrite
2006 Mar 31
13
validation with in_place_edit_for
i''ve got an in place edit text box for some of my fields. my model has validates_presence_of for the field but nothing happens. it works fine in the scaffold when using the edit page, but nowhere else. anyone have a solution to this? -- Posted via http://www.ruby-forum.com/.
2007 Aug 31
0
FW: sapply to return factors in dataframe
Ahhrg List, there was a hitch in the previous code. Updated and functional version follows after my initial question: I am trying to randomise a dataframe with mixed factors/numeric variables and return a new (randomised) dataframe with the same columns (as factors/numeric). simgap<-function(x) { ma<-max(x) mi<-min(x) Xout<-runif(length(x),min=mi,max=ma) return(Xout) }
2007 Jun 14
1
blotched y-axis text in plot function
Hi List, I have recently upgraded to opensuse10.2 and R 2.5 (compiled from source). Now, whenever I use plot the y-axis and labels are black blotches while x-axis and labels are fine. Using demo(graphics) this occurs with plot/boxplot/hist/pairs/coplot but not in the pie graphs and in the "The level of Interest in R" plot, which uses axis to define the y-axis. I presume this has to
2003 Sep 11
1
Is there any MFC-R2 implementation for asterisk?
The last thing that I read about it was: Steve Underwood [steveu@coppice.org] wrote on Sep 3: >> Is E&M designed to work with the E1 driver code? I think probably not. I >> had to fix some things to get proper access to the CAS signaling bits >> when I implemented MFC/R2... So, apparently he implemented it. I was trying to contact Steve, but he isn't answering me. Does
2006 Nov 27
2
[R-sig-Geo] plot() and Jpeg() increase font size and resolution
Thanks to Edzer and Roger, I can now plot with increased font sizes. However, jpeg still does not reproduce these, nor does it show up in high quality. What I would like to do is produce some highresolution jpegs. Any help would be appreciated Thanx Herry R2.4 on Mandriva 10.2 linux. Dr Alexander Herr Spatial and statistical analyst CSIRO, Sustainable Ecosystems Davies Laboratory, University
2007 May 18
1
error: GLX extension missing on server
Hi List, when loading library(rgl) I get error "RGL: GLX extension missing on server". I have Mesa and xgl installed, but xgl info sais its an highly experimental code. Does this mean I shouldn't bother for a while with opengl or are there alternatives? Any help appreciated Thanx Herry R 2.4.1 on x86_64 opensuse 10.2 Dr Alexander Herr - Herry Spatial and statistical analyst
2006 Apr 05
2
How to add add child items to parent via parent show view?
I want to know the standard/easiest way to add items to a parent? Example: comment added to post I would like this to happen in the ?show? view of post using a form that is shown when the user clicks the ?add new? button/link. I would also like validation on the child form with the validation errors appearing in the post show? view. Two problems are presented: 1) When the user clicks the
2007 Feb 01
1
rgl.postscript{rgl} crashes R
Hi list, I am trying to print a rgl scene. I can do this with rgl.snapshot("test.pnt",fmt="png"), but rgl.postscript("test.pdf",fmt="pdf") does crash R and returns to the linux shell after extented time period. I am running R 2.4.0 on i686 linux mandrake 10.2. Do I need any other R external program to make this work? Thanks Herry Dr Alexander Herr -
2004 Apr 20
1
Error while loading R2HTML in Rprofile
Hi List, When loading library(R2HTML) in Rprofile I get the following error: Error in firstlib(which.lib.loc, package) : couldn't find function "ps.options" Error in library(R2HTML) : .First.lib failed [Previously saved workspace restored] % ps.options is there % Loading the library from the command prompt works fine, other libraries load fine through Rprofile. % This
2004 Apr 29
1
R-crash using read.shape (maptools)
Hi List, I am trying to read a large shapefile (~37,000 polys) using read.shape [winxp, 1gig ram, dellbox). I receive the following error: AppName: rgui.exe AppVer: 1.90.30412.0 ModName: maptools.dll ModVer: 1.90.30412.0 Offset: 0000309d The getinfo.shape returns info, and the shapefile is readable in arcmap. Any ideas on how to overcome this? Thanks Herry
2006 Mar 14
3
How to save parent and child objects in a single action?
Hi! I''m struggling with it for a week. I posted a few similar posts that cleared up few things (thanks Mark!), but i still don''t know how to do it properly. What i''m trying to do is to create parent object and its many children (images - i tried using file_column, but it''s a topic for another post)using data from a single form. I''ve got a working
2006 Jul 16
0
Why does belongs_to handle "conflicts" this way?
When you define belongs_to in a model, you can either access association or association_id. I was wondering how Rails would handle things if you set each one to be different. I made two simple models: class Foo < ActiveRecord::Base; end class Bar < ActiveRecord::Base belongs_to :foo end Now here''s a script/console session. >> f = Foo.create => #<Foo:0x270ec10
2011 Jun 15
1
.new_record? and :_destroy
Rails version 2.3.8 I have a ticket model that has many comments the comments have an attribute called "admin" -- is this a comment added by an administrator the ticket has an attribute called "admin_email_address" I want to validate when saving the ticket and say "if I have a new admin comment, make sure I have an admin_email_address" In my ticket model, the
2005 Dec 22
0
Errors object missing when saving AR in Web Services method
Hello, I''m not able to get Errors object when saving some Model instance in ActionWebService::Base subclass. I want to create API method that will return ID of the object when saved successfully. When validation fails and the object is not saved I''d like the method to return ID, as well as the array of ValidationError custom struct. But I cannot fill in this because unsaved
2007 Oct 22
1
self-referential habtm: why are my keys null?
I''m trying to set up a directional self-referential HABTM to represent an arbitrary semi-hierarchical structure; it works for any data prepopulated into the db, but when I try to create a new relationship, I just get NULLs in both key columns (or 0''s if I turn on the no-null constraint). Here are the migrations: class CreateNodes < ActiveRecord::Migration def self.up
2006 Nov 24
2
plot() and Jpeg() increase font size and resolution
Dear list, I am having troubles increasing the fontize when plotting a variogram{gstat} and its model (vgm) with plot and using jpeg(). Also the resolution in the jpeg call does not work. I am using R2.4 on Mandriva 10.2 linux. I can change fontsize with cex.axis in a normal plot, so I presume it has to do with plotting the variogram model. Any help on how to increase the font size and