ActiveRecordError

1 view
Skip to first unread message

Johnny

unread,
Apr 8, 2009, 1:30:54 PM4/8/09
to Rails Authorization Plugin
Hi,

I have a User model:

class User < ActiveRecord::Base

# Authorization plugin
acts_as_authorized_user
acts_as_authorizable

(...)

end

a Ticket model:

class Ticket < ActiveRecord::Base
acts_as_authorizable

(...)

end

when a ticket is created the user who created becomes its owner:

@ticket.accepts_role 'owner', current_user

but when I try to delete the ticket I'm seeing the following message:

ActiveRecord::StatementInvalid in TicketsController#destroy
ActiveRecord::ActiveRecordError: Unknown column 'id' in 'where
clause': DELETE FROM `roles_users` WHERE (`id` IN (NULL))

Now, the table roles_users doesn't have a column 'id'. Where does 'id'
come from in the above generated SQL?

Thank you for your attention,

Johnny
Reply all
Reply to author
Forward
0 new messages