Skip to content

Commit

Permalink
Make Common#to_class_name method return base_class name in order to w…
Browse files Browse the repository at this point in the history
…ork with STI models - #89 #139
  • Loading branch information
simukappu committed Nov 3, 2020
1 parent 532d0dd commit 8e6136e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/activity_notification/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ def resolve_value(thing, *args)
end

# Convets to class name.
# This function returns base_class name for STI models if the class responds to base_class method.
# @see https://github.com/simukappu/activity_notification/issues/89
# @see https://github.com/simukappu/activity_notification/pull/139
# @return [String] Class name
def to_class_name
self.class.name
self.class.respond_to?(:base_class) ? self.class.base_class.name : self.class.name
end

# Convets to singularized model name (resource name).
Expand Down

0 comments on commit 8e6136e

Please sign in to comment.