Skip to content

Commit

Permalink
Support polymorphic parents defined as strings, fixes railsadminteam#385
Browse files Browse the repository at this point in the history
  • Loading branch information
kaapa committed May 3, 2011
1 parent 66a0233 commit 0e2c1d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rails_admin/adapters/active_record.rb
Expand Up @@ -10,7 +10,7 @@ def self.polymorphic_parents(name)
@polymorphic_parents = {}
RailsAdmin::AbstractModel.all.each do |abstract_model|
abstract_model.polymorphic_associations.each do |association|
(@polymorphic_parents[association[:options][:as]] ||= []) << abstract_model
(@polymorphic_parents[association[:options][:as].to_sym] ||= []) << abstract_model
end
end
end
Expand Down

0 comments on commit 0e2c1d4

Please sign in to comment.