Commit 131144ba4f279e1604ef9dc4444660d2dc14c13b
1 parent
c68b621c
Exists in
master
and in
29 other branches
tolerance-time-plugin: use base_class instead of hard-coded class name
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
plugins/tolerance_time/lib/tolerance_time_plugin/publication.rb
... | ... | @@ -5,8 +5,7 @@ class ToleranceTimePlugin::Publication < Noosfero::Plugin::ActiveRecord |
5 | 5 | |
6 | 6 | class << self |
7 | 7 | def find_by_target(target) |
8 | - kind = target.kind_of?(Article) ? 'Article' : 'Comment' | |
9 | - find_by_target_id_and_target_type(target.id, kind) | |
8 | + find_by_target_id_and_target_type(target.id, target.class.base_class.name) | |
10 | 9 | end |
11 | 10 | end |
12 | 11 | ... | ... |