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

undefined method 'associations'

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      I have a relational association like this one
      <pre><code>class Person
      include Mongoid::Document
      references_one :policy
      end

      class Policy
      include Mongoid::Document
      referenced_in :person
      end
      </code></pre>
      And in my capture form I do something like this:

      <pre><code>.field
      = f.label :policy
      = f.select :policy, Policy.find(:all).collect

      { |c| [c.name,c.id]}

      </code></pre>
      and I get this error on updating:
      <pre><code>undefined method `associations' for "4ca2cd498886c1205d000001":String
      </code></pre>
      any thoughts?

            Assignee:
            Unassigned Unassigned
            Reporter:
            djfobbz Rick Sandhu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: