Hey all,

How is this currently working in AS?   I have a subform that allows
the editing of the sub-item and the creation of a new item
simultaneously.  In what order does that take place?   I would like it
to perform the Updates FIRST and then do the creates in order of
creation.  Here's why:

The subform looks like this:


 Price       StartDate     EndDate
> $13       2/12/2010     [5/15/2010]
  [$20]      [5/16/2010]   [      ]


The ">" indicates an existing record and the [ ] indicates fields that
are being edited/created.
So the first record ($13) is an existing one, and it starts with a
NULL EndDate (basically meaning that the price is valid forever).  The
user wants to go up and close out that price (adding in 5/15/2010 as
the new EndDate) and create a new Price at the same time.

Now, I have a validation in place that makes sure that dates don't
overlap.  Date's would overlap for a number of reasons, but in this
case, for some reason, the CREATE is taking place first, and since it
has a NULL EndDate and the old record *also* has a NULL EndDate, it
views that as overlapping and the validation fails.

If, however, the UPDATE were to take place first, the old record would
be updated with an EndDate that would occur *before* the StartDate of
the new record, and validation would succeed.

Thoughts/help?

MANY THANKS!!
M

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to