在 Rolify 中查找特定资源实例的所有角色

Finding all roles for a particular resource instance in Rolify

如何在 Rolify 中找到特定资源实例的所有角色? documentation 建议如下:

Forum.find_roles
# => [ list of roles that binded to any Forum instance or to the Forum class ]

但是如果我想要一个特定的 Forum 实例怎么办? Forum.first.find_roles 不起作用。还有别的办法吗?这是我尝试使用 Location 而不是 Forum:

2.1.5 :003 > Location.first.find_roles
  Location Load (0.3ms)  SELECT  "locations".* FROM "locations"  ORDER BY "locations"."id" ASC LIMIT 1
NoMethodError: undefined method `find_roles' for #<Location:0x007fbe880d1b48>
    from /Users/scott/.rvm/gems/ruby-2.1.5@rails4/gems/activemodel-4.2.1/lib/active_model/attribute_methods.rb:433:in `method_missing'
...
...
...

Location.first.roles 应该可以。

参考:https://github.com/RolifyCommunity/rolify#instance-level