Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderating associations #21

Open
ngw opened this issue Feb 1, 2013 · 1 comment
Open

Moderating associations #21

ngw opened this issue Feb 1, 2013 · 1 comment

Comments

@ngw
Copy link

ngw commented Feb 1, 2013

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?

@mrbrdo
Copy link
Owner

mrbrdo commented Apr 12, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants