{"comment":{"created_at":"2011-10-19T19:40:31Z","body":"It worked brilliantly! :D Thank you very much. It is a very good gem. I am actually surprised it is not more popular. I think I will give it a mention at an upcoming Rails meeting in Montreal.","updated_at":"2011-10-19T19:40:31Z","url":"https://api.github.com/repos/mrbrdo/has_moderated/issues/comments/2460242","id":2460242,"user":{"avatar_url":"https://secure.gravatar.com/avatar/36dd57407828b5454b3b86f00e47fa79?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"36dd57407828b5454b3b86f00e47fa79","url":"https://api.github.com/users/jackquack","id":554881,"login":"jackquack"}},"action":"created","issue":{"number":2,"created_at":"2011-10-17T19:30:33Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I am having trouble using this gem with a model FOOBAR which has_one FOO, :through => :BAR. Just to be clear, the model FOO belongs_to BAR which is polymorphic. \r\n\r\nModel FOOBAR\r\nhas_one :FOO, :as => :BAR\r\nhas_moderated_create :with_associations => :all\r\nModel FOO\r\nbelongs_to :BAR, :polymorphic => true\r\n\r\nIt is trying to set FOODBAR= to something when I accept a moderated entry in the FOOBAR table.  It should be setting BAR=, because BAR is the name of the polymorphic association name.\r\n\r\nAn example is \r\nModel Admin\r\nhas_one :user, :as => :account\r\nhas_moderated_create :with_associations => :all\r\nModel User\r\nbelongs_to :account, :polymorphic => true\r\nSo, Admin has_moderated_create and when I try to accept an entry in this table using Admin.all.last.accept, I get an exception saying that Admin has no method user=. It is correct that Admin does not have a method user=. The correct method is account=. Admin has_one :user, :as => :account","comments":8,"title":"Polymorphic Associations","updated_at":"2011-10-19T19:40:31Z","url":"https://api.github.com/repos/mrbrdo/has_moderated/issues/2","id":1932421,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/36dd57407828b5454b3b86f00e47fa79?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"36dd57407828b5454b3b86f00e47fa79","url":"https://api.github.com/users/jackquack","id":554881,"login":"jackquack"},"html_url":"https://github.com/mrbrdo/has_moderated/issues/2","labels":[],"state":"open"},"legacy":{"issue_id":1932421,"comment_id":2460242}}