Johnny
unread,Apr 8, 2009, 1:30:54 PM4/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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