has_moderated
has_moderated copied to clipboard
Moderating associations
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?
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.