Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-410

Paranoia module with embedded documents throws error

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.3.1
    • Component/s: None
    • Labels:

      Description

      I've encountered and issue when trying to use Mongoid::Paranoia on
      embedded document.
      The models look like this:
      http://gist.github.com/548876
      If I try to change simple destroy method call into .delete method call
      like this:
      def destroy
      @expense = @project.expenses.find(params[:id])
      @expense.delete
      ......
      end
      It throws me an error on line with @expense.delete:
      Access to the collection for Expense is not allowed since it is an
      embedded document, please access a collection from the root document.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            aziz M
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: