This is a terribly basic question around has_many/belongs_to
relationships and the "Add Existing" functionality that isn't working
as I'd expect.

Given:

class Program < ActiveRecord::Base
  has_many :organizations
end

class Organization < ActiveRecord::Base
  belongs_to :program
end

Use Case:

1. Create Program through AS called "Program 1" (verify successful)
2. Create Organization through AS called "Org 1", select "Program 1"
in select list and click "Add Existing" (verify Org 1 created
successfully)
3. Create another Organization through AS call "Org 2" selecting the
same Program as Org 1.

What AS does at that point is strange, it first goes and sets "Org 1"s
program to null, and then goes and creates "Org 2" with that program.
It's like AS thinks the relationship is has_one/belongs_to instead of
has_many/belongs_to. It won't allow multiple Org rows attached to the
same Program...which it darn well should.

What am I missing? (something simple I'm sure)

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