Add comments clarifying alias_method
in MongoidAdditions
This commit is contained in:
parent
5ebca1f9bf
commit
84c590e8c7
|
@ -1,6 +1,7 @@
|
||||||
module CanCan
|
module CanCan
|
||||||
|
|
||||||
module Ability
|
module Ability
|
||||||
|
# could use alias_method_chain, but it's not worth adding activesupport as a gem dependency
|
||||||
alias_method :query_without_mongoid_support, :query
|
alias_method :query_without_mongoid_support, :query
|
||||||
def query(action, subject)
|
def query(action, subject)
|
||||||
if Object.const_defined?(:Mongoid) && subject <= CanCan::MongoidAdditions
|
if Object.const_defined?(:Mongoid) && subject <= CanCan::MongoidAdditions
|
||||||
|
@ -56,6 +57,8 @@ module CanCan
|
||||||
matches_conditions_hash_without_mongoid_subject? subject, conditions
|
matches_conditions_hash_without_mongoid_subject? subject, conditions
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# could use alias_method_chain, but it's not worth adding activesupport as a gem dependency
|
||||||
alias_method :matches_conditions_hash_without_mongoid_subject?, :matches_conditions_hash?
|
alias_method :matches_conditions_hash_without_mongoid_subject?, :matches_conditions_hash?
|
||||||
alias_method :matches_conditions_hash?, :matches_conditions_hash_with_mongoid_subject?
|
alias_method :matches_conditions_hash?, :matches_conditions_hash_with_mongoid_subject?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user