has_moderated icon indicating copy to clipboard operation
has_moderated copied to clipboard

Moderating associations

Open ngw opened this issue 12 years ago • 1 comments

These are my models:

class Deal < ActiveRecord::Base
    has_many :pictures, :as => :imageable, :dependent => :destroy
    has_moderated :title, :excerpt, :description, :conditions, :associations => [ :pictures ]
end

class Picture < ActiveRecord::Base
    belongs_to :imageable, :polymorphic => true
    mount_uploader :image, PictureUploader
    attr_accessible :image
    include HasModerated::CarrierWave
    has_moderated_create
    has_moderated_carrierwave_field :image
end

What happens here is that when I save a deal with a new picture, the moderation object saved in the db is a picture object. I would like the moderation_type to be Deal and save the picture as an association, is this possible?

ngw avatar Feb 01 '13 15:02 ngw

Hey I am really sorry for such a late answer, I did not receive an email notification about this. Are you still experiencing this problem?

I am not sure about the syntax you are using to moderate assoications, you need to use has_moderated_association.

mrbrdo avatar Apr 12 '13 18:04 mrbrdo