Strange "bug"? after application update to 2.3.2 from 2.1.2

2 views
Skip to first unread message

alexey

unread,
Jun 18, 2009, 4:07:30 AM6/18/09
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")

Glenn Rempe

unread,
Jun 18, 2009, 2:18:43 PM6/18/09
to Rails Authorization Plugin
Wondering if this could be related to rails inflector acting
strangely?

http://api.rubyonrails.org/classes/Inflector.html

Maybe try (what I think is) the correct English inflections. Its
worth a shot...

attendees and attendee

http://www.merriam-webster.com/dictionary/attendee

$ ./script/console
Loading development environment (Rails 2.3.2)
warning: peer certificate won't be verified in this SSL session
>> "attendee".pluralize
=> "attendees"
>> "attendees".singularize
=> "attendee"
>> "attendy".pluralize
=> "attendies"
>> "attendies".singularize
=> "attendy"

Cheers,

Glenn

alexey

unread,
Jun 21, 2009, 3:58:01 AM6/21/09
to Rails Authorization Plugin
With me it is "attendy"=>"attendies" and "attendies"=>"attendy"
with console of application.

However it anyway should return [] for responce of "has_*" method.
If model are acts_as_authorizable so it should have all of "has_*"
methods, even if no "attendies" at all..

like:
@community.has_chikens
>> []
Reply all
Reply to author
Forward
0 new messages