Skip to content

Commit 22755f2

Browse files
author
Kyle d'Oliveira
authored
Merge pull request #30 from rhemsing/constant-lookup
Change how constant name is found
2 parents 16aa0d0 + fc53546 commit 22755f2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/polymorphic_integer_type/extensions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def remove_type_and_establish_mapping(name, options, scope)
9595
def retrieve_polymorphic_type_mapping(polymorphic_type:, class_name:)
9696
return if polymorphic_type.nil?
9797

98-
belongs_to_class = class_name.safe_constantize
98+
belongs_to_class = compute_type(class_name)
9999
method_name = "#{polymorphic_type}_type_mapping"
100100

101101
if belongs_to_class && belongs_to_class.respond_to?(method_name)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module PolymorphicIntegerType
2-
VERSION = "2.2.4"
2+
VERSION = "2.2.5"
33
end

spec/polymorphic_integer_type_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class InlineDrink2 < ActiveRecord::Base
261261

262262
self.table_name = "drinks"
263263

264-
has_many :inline_links2, as: :target
264+
has_many :inline_link2s, as: :target
265265
end
266266

267267
let!(:animal) { InlineAnimal2.create!(name: "Lucy") }

0 commit comments

Comments
 (0)