Skip to content

Commit 774431d

Browse files
author
Kyle d'Oliveira
committed
Reflections are now strings, so we will need to call to_s on the mapping name
1 parent 09745be commit 774431d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/polymorphic_integer_type/extensions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def belongs_to(name, scope = nil, options = {})
99
super
1010
if options[:polymorphic] && integer_type
1111
mapping = PolymorphicIntegerType::Mapping[name]
12-
foreign_type = reflections[name].foreign_type
12+
foreign_type = reflections[name.to_s].foreign_type
1313
self._polymorphic_foreign_types << foreign_type
1414

1515
define_method foreign_type do

0 commit comments

Comments
 (0)