Skip to content

Instantly share code, notes, and snippets.

@bowsersenior
bowsersenior / cancan_mongoid.rb
Created September 2, 2010 00:42 — forked from blackgold9/mongoid_addtions.rb
How to get CanCan to work with Mongoid 2
module CanCan
class Query
def sanitize_sql(conditions)
conditions
end
end
# customize to handle Mongoid queries in ability definitions conditions
class CanDefinition
def matches_conditions_hash?(subject, conditions = @conditions)