has_and_belongs_to_many no method error

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a code

      class Person
        has_and_belongs_to_many :things
      end
      class Thing
        has_and_belongs_to_many :people
      end
      

      which results in

      @person.things #no method

      And this code fixes this. Is it bug? If not it is not clear why this happens.

      class Person
        has_and_belongs_to_many :things, :inverse_of => :people
      end
      class Thing
        has_and_belongs_to_many :people, :class_name => 'Person'
      end
      

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

                Created:
                Updated:
                Resolved: