Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorw committed Mar 31, 2022
1 parent 1b05019 commit 445cb05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/discriminable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Discriminable
extend ActiveSupport::Concern

included do
class_attribute :discriminable, instance_writer: false
class_attribute :discriminable_map, instance_writer: false
class_attribute :discriminable_inverse, instance_writer: false
end

Expand All @@ -35,7 +35,7 @@ def discriminable(**options)

discriminator, map = options.first

self.discriminable = map.with_indifferent_access
self.discriminable_map = map.with_indifferent_access
self.discriminable_inverse = map.invert
self.inheritance_column = discriminator.to_s
end
Expand All @@ -45,7 +45,7 @@ def sti_name
end

def sti_class_for(value)
return self unless (type_name = discriminable[value])
return self unless (type_name = discriminable_map[value])

super type_name
end
Expand Down

0 comments on commit 445cb05

Please sign in to comment.