alexey
unread,Jun 18, 2009, 4:07:30 AM6/18/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 all,
I worked on 2.1.2 with authorization plugin, after i updated to 2.3.2
i had something very strange,
Okay there is facts:
1)
class Community < ActiveRecord::Base
acts_as_authorizable
has_many :forums
has_many :subscriptions, :dependent => :destroy
belongs_to :artist
has_and_belongs_to_many :users
end
some code in controllers:
2)
current_user.is_attendy_of @community
>>>>
=> [#<Role id: 1, name: "admin", authorizable_type: nil,
authorizable_id: nil, created_at: "2008-08-03 16:41:45">, #<Role id:
191, name: "attendy", authorizable_type: "Community", authorizable_id:
582, created_at: "2009-06-18 10:56:15">]
then:
3)
@artist = Artist.find_by_link(params[:link])
@community = @artist.community
@attendies = @community.has_attendies
>>>>
=> undefined method `has_attendies' for "#<Community:
0xb47eba44>":Community
On line #18
in console:
4)
community.accepted_roles
>>>>
=> [#<Role id: 191, name: "attendy", authorizable_type: "Community",
authorizable_id: 582, created_at: "2009-06-18 10:56:15">]
--
What is strange, because similar model working well:
@artists.has_members
=> [User, User]
Googleizing not helps
(sorry for bad "en")