Displaying 20 results from an estimated 900 matches similar to: "Validation dependent on unsaved parent"
2006 May 20
10
HOW TO create a new record and its associated objects within the SAME PAGE
hi,
can''t find any good tutorial or advice to deal with the creation of a
new record and it''s associated objects within the same page.
do i have to use ajax just to add custom form fields that will be
handled by the controller for associated objects creation.?
do i have to use ajax to add associated objects to the unsaved but
allready in session parent object?
what''s
2013 Feb 06
0
inverse_of breaks for unsaved child associations during save of parent
I''m willing to write a patch for this issue:
https://github.com/rails/rails/issues/8893
But want to confirm that the new behavior makes sense before I make the
effort.
Essentially if you have an unsaved parent and child, and the parent''s
association to the child has an inverse_of declared on it. When the parent
gets saved, it updates the foreign key on the child, and this
2008 Apr 28
1
OSX R GUI visual interface tweak (PR#11318)
Full_Name: Ana Nelson
Version: R 2.7.0 GUI 1.24 (5102)
OS: OSX 10.5.2
Submission from: (NULL) (213.94.201.89)
The R GUI close button has a solid circle. Screenshot is here:
http://skitch.com/ananelson/kmxj/r-console
On OSX this indicates that there are unsaved changes pending. Please see page
201 of the Apple Human Interface Guidelines (version 2008-03-11):
2006 Mar 13
2
relationship woes
I have two tables:
class PgmUpdate < ActiveRecord::Base
has_many :pgm_visits, :foreign_key => ''pgm_update_fk''
...
and
class PgmVisit < ActiveRecord::Base
belongs_to :pgm_update, :foreign_key =>
''pgm_update_fk'', :dependent => true
...
According to the has_many docs (http://api.rubyonrails.org/classes/
2006 Mar 28
2
R crashes during 'eigen'
Hi all,
Hi,
When I want to compute the eigenvalues & eigenvectors of a specific
matrix, R crashes (i.e. it stops responding to any input). I've tried it
with different versions of R (2.1.1, 2.2.0, 2.2.1) - all with crashing
as result.
What I did before the crash was:
M <- as.matrix(read.table("thematrix",header=T))
eigen(M)
If, instead of eigen(M), I use eigen(M,
2006 Mar 14
2
Two unsaved related objects
Given the two tables Parent, Child where Parent has_many children:
If I don''t save parent first then it seems that child.parent will not
be assigned automatically if I call parent.children << child . Must
the parent record be saved before I call parent.children << child ?
If I must save Parent first then can someone explain to me how I can
call parent.valid? before it
2003 Jun 03
3
Server overloaded? Or is it a bug?
Hi all!
I need your help.
My server doesn't respond any more. Everything crashed.
How can I find out if this is a bug or it is simply overloaded?
I don't have much running, just KDE with about 10 programs
on each of the 16 desktops, and a few background processes.
This seems much, but I often have much more stuff running,
and it is not even slow.
It does respond when I ping it, but
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>
2005 Dec 27
4
How do you detect if ActiveRecord ''update'' fails?
So I''m updating multiple model objects in one go with something like
this in my controller:
=> Photo.update(params[:photo].keys, params[:photo].values)
When the update fails due to validation errors, how do I detect it?
The Rails API says:
"If the save fails under validations, the unsaved object is still
returned."
So I can''t simply do this:
=> if
2006 Jun 03
1
Can I tell if the associated record is new in a belongs_to save?
In a belongs_to association, is there a way to tell if the associated object
was newly created?
Hopefully this will explain my question:
A Firm class declares
has_many<http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html#M000530>:clients
and a
client class declares
2005 Dec 27
1
How do you detect if ''update'' save fails?
So I''m updating multiple model objects in one go with something like
this in my controller:
=> Photo.update(params[:photo].keys, params[:photo].values)
When the update fails due to validation errors, how do I detect it?
The Rails API says:
"If the save fails under validations, the unsaved object is still
returned."
So I can''t simply do this:
=> if
2015 Mar 12
1
[PATCH] generator: small optimization of pod2text cache memoization
Instead of save every time there's a new element in the cache, batch the
saving to disk every 100 changes, saving the unsaved remainder at the
exit.
While not a big optimization, this reduces a bit the disk usage during
generator run.
---
generator/utils.ml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/generator/utils.ml b/generator/utils.ml
index
2019 Oct 12
1
Password issue
On Oct 11, 2019, at 7:26 PM, @lbutlr via dovecot <dovecot at dovecot.org> wrote:
>
> setting the explicit port for SMTP and.or IMAP advanced settings didn?t change the port it actually tried connecting go until I removed the account and re-added it.
I'm sure you tried this before deleting/re-adding, but just in case not: you do have to close out of the settings window (or switch
2002 Sep 10
1
print command %J (job name) problem
i'm setting up a samba pdf (virtual) printer. it all works, except that
i can't get the windows' job name, to give a readable (and consistent)
name to the generated pdf file. according to the manpage i can use %J to
get the job name, but it doesn't work. the clients are win98 boxes. i
tried to print either a test page, a unsaved word doc and a saved word
doc.
this is the
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations?
order = Order.new(:name => "My Order")
order.line_items << LineItem.new(:product_id => 1, :quantity => 2)
order.line_items << LineItem.new(:product_id => 2, :quantity => 5)
order.save
The above - which is by far the most elegant way of putting it - doesn''t
work for me - the line_items
2006 Sep 03
2
Undefined method "xxx" of a model when calling a helper
Hi all
I''m creating a shop page. I have a cart model that looks like the
following:
class Cart
attr_reader :line_items
def get_line_item id
@line_items.each do |l|
return l if l.id == id
end
end
def initialize
@line_items = []
end
def empty!
initialize
end
def empty?
return true if @line_items.empty?
false
end
end
And I have some
2006 Jul 20
1
Having issues saving line items to the DB
Hello everyone, I''m fairly new to Rails (writing my first real app) and
brand new to this mailing list.
I''ve got a rails/sql error I just can''t seem to solve. It''s probably
really simple, but I''m been googling and reading for a day and have made
zero progress on it. Hopefully someone on this list can shine some light
on my problem, or point me in the
2006 Jun 24
2
Migrations problem with Agile Rails book
I am following the instructions on Agile Web Development with Rails book "Iteratio E1: Capturing
an Order" section. When I run the migrations I get the following error.
rake db:migrate
(in /Users/balaparanj/work/depot)
-- execute("alter table line_items \n
add constraint fk_line_item_products \n
foreign key (product_id) references products(id)")
rake
2006 Oct 13
3
How to get a count of line_items
I am fairly new to Rails, and I am having difficulty in forgetting the
old way of developing and using the Rails way.
This is my question, using orders and line_items as an example.
An order has_many line_items
A line_item belongs to order
In my OrdersController I have
def summary
@orders = Orders.find(:all)
render :xml => @orders.to_xml()
end
What I want to achieve is to