Polymorphic belongs to association - rafaellima/rails_admin GitHub Wiki
Synopsis:
class Comment < ActiveRecord::Base
belongs_to :commentable, :polymorphic => true, :inverse_of => :comments
attr_accessible :commentable_id, :commentable_type
rails_admin do
configure :commentable do
# configuration here
end
end
end
# for info
class Team < ActiveRecord::Base
has_many :comments, :as => :commentable, :inverse_of => :commentable
end