Updated active_scaffold gem to 3.1.10 and still seeing the same
problem. Here's the log traffic showing the issue when creating a new
org selecting the same parent Program:


Started POST "/organizations" for 127.0.0.1 at 2011-11-29 11:27:23
-0700
  Processing by OrganizationsController#create as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"f2SgrBTEMh9JupF
+jXiZtrSy77Rf0ifXk+EOM7PmEhk=", "record"=>{"name"=>"Org 3",
"email"=>"[email protected]", "address_1"=>"", "address_2"=>"",
"city"=>"", "phone"=>"", "state"=>"", "url"=>"", "zip"=>"",
"program"=>{"name"=>"Demo", "description"=>"Demo program", "id"=>"1"},
"products"=>{"1322591204075"=>{"name"=>"", "description"=>""}}},
"associated_id"=>"1", "commit"=>"Create"}
  Program Load (0.1ms)  SELECT "programs".* FROM "programs" WHERE
"programs"."id" = ? LIMIT 1  [["id", "1"]]
  Organization Load (0.2ms)  SELECT "organizations".* FROM
"organizations" WHERE "organizations"."program_id" = 1

Here's where it sets all existing organization.program_id values to
NULL ...WHY??

SQL (0.5ms)  UPDATE "organizations" SET "program_id" = NULL WHERE
"organizations"."program_id" = 1 AND "organizations"."id" IN (1)

After that now it creates the new org...

  SQL (45.0ms)  INSERT INTO "organizations" ("address_1", "address_2",
"city", "created_at", "email", "name", "phone", "program_id", "state",
"updated_at", "url", "zip") VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [["address_1", nil],
["address_2", nil], ["city", nil], ["created_at", Tue, 29 Nov 2011
18:27:23 UTC +00:00], ["email", "[email protected]"], ["name",
"Org 3"], ["phone", nil], ["program_id", 1], ["state", nil],
["updated_at", Tue, 29 Nov 2011 18:27:23 UTC +00:00], ["url", nil],
["zip", nil]]


On Nov 29, 1:59 am, Sergio Cambra <[email protected]> wrote:
> On Lunes, 28 de noviembre de 2011 19:42:42 Kyle escribió:
>
>
> > On Nov 28, 6:24 am, Sergio Cambra <[email protected]> wrote:
> > > On Sábado, 26 de noviembre de 2011 17:28:00 Kyle escribió:
> > > > Should have mentioned this is using Rails 3.1.1 and active_scaffold
> > > > 3.1.8
>
> > > I have tried it with 3.1.10 and it's working. Can you tried updating
> > > active_scaffold?
>
> > Will do.
>
> > > Have you overrided some controller or helper methods, or some
> > > views?
>
> > Have not overridden anything, default controllers and helpers. All
> > I've done is generate scaffolds with the AS generator, fill in the
> > migrations, migrate, define models as previously shown. That's it.
>
> > It's been a couple years since I've used AS, but I would expect this
> > basic of a use case to still be the same and work with minimal effort.
>
> Yes, it should work, I have fixed the bug in master branch.

-- 
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