<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -62,9 +62,11 @@ module Authorization
 
         def roles_for( authorizable_obj )
           if authorizable_obj.is_a? Class
-            self.roles.select { |role| role.authorizable_type == authorizable_obj.to_s }
+            self.roles.find(:all, :conditions =&gt; { :authorizable_type =&gt; authorizable_obj.to_s})
           elsif authorizable_obj
-            self.roles.select { |role| role.authorizable_type == authorizable_obj.class.base_class.to_s &amp;&amp; role.authorizable.id == authorizable_obj.id }
+            self.roles.find(:all, :conditions =&gt; {
+                              :authorizable_type =&gt; authorizable_obj.class.base_class.to_s, 
+                              :authorizable_id =&gt; authorizable_obj.id })
           else
             self.roles.select { |role| role.authorizable.nil? }
           end</diff>
      <filename>lib/publishare/object_roles_table.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>139b6d5794736daab6a7f6483def2e358856c3de</id>
    </parent>
  </parents>
  <author>
    <name>Tim Wong</name>
    <email>timlikesdogs@gmail.com</email>
  </author>
  <url>http://github.com/DocSavage/rails-authorization-plugin/commit/09ce50e2f35e7fd74f5298ca9f99aca7ab770acc</url>
  <id>09ce50e2f35e7fd74f5298ca9f99aca7ab770acc</id>
  <committed-date>2009-05-11T15:26:12-07:00</committed-date>
  <authored-date>2009-04-06T16:22:17-07:00</authored-date>
  <message>Don't use Array#select, so that has_no_roles and has_no_roles_for will work.
This also prevents the active record objects from being instantiated prematurely.

Signed-off-by: Glenn Rempe &lt;glenn@rempe.us&gt;</message>
  <tree>5bc5aa812b213f93619955b6fa1b95e72104ce67</tree>
  <committer>
    <name>Glenn Rempe</name>
    <email>glenn@rempe.us</email>
  </committer>
</commit>
