Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't crash when the polymorphic _type value is nil

  • Loading branch information...
commit b2f98f13daf282c09eb5414a5d73655b87eb60aa 1 parent b69430a
@Empact authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/polymorphic_include.rb
View
1  lib/polymorphic_include.rb
@@ -48,6 +48,7 @@ class << object
if res.respond_to? :group_by
res.group_by {|r| r.send "#{sym.to_s}_type"}.each do |stype, set|
begin
+ next if stype.nil?
stype_class = Object.const_get stype
id_sym = "#{sym.to_s}_id".to_sym
ids = set.collect(&id_sym)
Please sign in to comment.
Something went wrong with that request. Please try again.