I would try this: def authorized_for_destroy? self[:owner_id] == current_user_id end
notice I also removed the return true and if statement, those aren't needed. the method will return true or false depending on what that evaluates to. I'm not sure if this will work but give it a try. On Fri, Jan 8, 2010 at 1:27 PM, GreatJohn <[email protected]> wrote: > I got the act_as_authenticated plugin working on rails 2.3.5 and I'm > noticing something weird. > When declaring authorized_for..methods in models I can't access the > column names from the particular model in the method. > Say I have a model Garage and then > def authorized_for_destroy? > return true if (owner_id == current_user.id) > end > > owner_id is the column in garage table. Does anyone know why I can't > access columns from Garage model in the authorized method? > > -- > 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]<activescaffold%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/activescaffold?hl=en. > > > >--
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.
