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

association_ids method

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

      When I define a has_many :photos association I would like to have photo_ids and photo_ids= methods. Right now I define them myself:

      def photo_ids=(ids)
        self.photos = Photo.find(ids)
      end
      

      This is useful if I have a form with many checkboxes named doc[photo_ids][] so that on submit photos are set on update_attributes automatically. Active Record already has this.

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

              Created:
              Updated:
              Resolved: