title: mongoid .where queries not working as expected
body: <p>I have a model that belongs_to another:</p>
  
  <pre><code>class Permission
    include Mongoid::Document
    belongs_to :action
    field :action_id, type: String
  </code></pre>
  
  <p>And a corresponding has_many model:</p>
  
  <pre><code>class Action
    include Mongoid::Document
    has_many :permissions
  </code></pre>
  
  <p>I am seeing that 2 basic ActiveRecord queries are not working:</p>
  
  <p>First, sending the object instead of the object id does not work:</p>
  
  <pre><code>action = Action.first
  permissions = Permission.where(action: action)
  permissions.count # this is always 0
  </code></pre>
  
  <p>However, if I use the id, it works fine:</p>
  
  <pre><code>Permission.where(action_id: action.id) # this works fine
  </code></pre>
  
  <p>Second, sending an array of ids does not work, ever:</p>
  
  <pre><code>Permission.where(action_id: [action.id]) # always empty
  </code></pre>
  
  <p>Does mongoid not support basic ActiveRecord queries?  If not, for the first problem, I can work around it by always using the object id, but for the second, how do I search by an array of targets?</p>
  
  <p>Thanks for any help,
  Kevin</p>