Sergio,

I fixed the problem.

I changed my relationships to has_and_belongs_to_many and it started
functioning as anticipated. I'm not sure if this is an activescaffold
bug or not. I'm going to put together a bare bones example app in the
next couple days and upload it to my acct on github. When I do that I
can link it to you to share with the team, or for you to look at to
see if theres are reason it's working this way.

On Aug 6, 8:36 am, kwb <[email protected]> wrote:
> As far as I can tell its DA that's breaking the has_many :through
> relationship.
>
> And to clear things up, it's my understanding that i would modify
> the :roles column in AS, because a user has many roles through
> assignments, and modifying the roles through active scaffold is
> actually modifying the join table (assignments) between the users and
> roles models.
>
> On Aug 6, 2:37 am, "Sergio Cambra .:: entreCables S.L. ::."
>
>
>
> <[email protected]> wrote:
> > On Jueves, 5 de Agosto de 2010 20:31:58 kwb escribió:
>
> > > I'm creating an app and I'm using the three plugins listed in the
> > > subject line.
>
> > > I can create an app without authlogic and declarative_authorization
> > > (DA), and I can edit has_many :through relationships.
>
> > > As soon I incorporate authlogic and DA, I can no longer edit
> > > has_many :through relationship.
>
> > What do you change in your models or active scaffold controllers when you 
> > add
> > DA? Does adding only authlogic break editing has_many :through?
>
> > > I am trying to add roles to a user through the users active scaffold
> > > interface.
>
> > > My code is as follows for users, roles, and assignments
>
> > > class User < ActiveRecord::Base
> > >   has_many :assignments
> > >   has_many :roles, :through => :assignments
>
> > >   def role_symbols
> > >     roles.collect {|r| r.name.underscore.to_sym}
> > >   end
> > > end
>
> > > class Assignment < ActiveRecord::Base
> > >   belongs_to :user
> > >   belongs_to :role
> > > end
>
> > > class Role < ActiveRecord::Base
> > >   has_many :roles
> > >   has_many :users, :through => :assignments
> > > end
>
> > > Any help in solving this would be greatly appreciated as I am a Rails
> > > newbie (I started monday)
>
> > --
> > Sergio Cambra .:: entreCables S.L. ::.
> > Mariana Pineda 23, 50.018 Zaragoza
> > T) 902 021 404 F) 976 52 98 07 E) [email protected]

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