Skip to content

Commit

Permalink
fixing ordering bug (got longer and longer ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschrammel committed Mar 7, 2009
1 parent ceebfab commit 21560b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/active_acl/handler/object_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def has_privilege?(requester,privilege,target=nil)
sql << "\n ORDER BY "

#TODO: ordering is a mess (use an array?)
order = (grouped? ? order_by_3d : [])
order = (grouped? ? order_by_3d.dup : [])
if t_handler.grouped?
order << "(CASE WHEN t_g_links.acl_id IS NULL THEN 0 ELSE 1 END) ASC"
order << t_handler.group_handler.order_by(target,true)
Expand All @@ -68,6 +68,7 @@ def has_privilege?(requester,privilege,target=nil)
vars['privilege_id'] = privilege.id
vars['target_id'] = target.id
vars['target_type'] = target.class.base_class.name
#vars['target_group_id'] = t_handler. association_foreign_key unless t_handler.habtm?
else
sql << " WHERE "
sql << query_r_where_2d
Expand Down

0 comments on commit 21560b5

Please sign in to comment.