Module: Mongoid::Criteria::Permission
| Relationships & Source Files | |
| Defined in: | lib/mongoid/criteria/permission.rb | 
Overview
Mixin module for ::Mongoid::Criteria which adds strong parameters validation when using ActionController::Parameters objects as arguments to condition methods.
Instance Method Summary
- 
    
      #should_permit?(criteria)  ⇒ true | false 
    
    private
    Internal use only
    Internal use only
    Ensure that the criteria are permitted. 
Instance Method Details
    #should_permit?(criteria)  ⇒ true | false  (private)
  
  
    This method is for internal use only.
  
Ensure that the criteria are permitted.
# File 'lib/mongoid/criteria/permission.rb', line 63
def should_permit?(criteria) if criteria.respond_to?(:permitted?) return criteria.permitted? elsif criteria.respond_to?(:each) criteria.each do |criterion| return false unless should_permit?(criterion) end end true end