Skip to content

Commit

Permalink
fixing for rails 5 application record compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
dza2000 committed Feb 19, 2016
1 parent a04dfa0 commit c784534
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/acts_as_follower/follower_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ module FollowerLib

# Retrieves the parent class name if using STI.
def parent_class_name(obj)
if obj.class.superclass != ActiveRecord::Base
return obj.class.superclass.name
if obj.class.superclass == ActiveRecord::Base ||
obj.class.superclass.superclass == ActiveRecord::Base
return obj.class.name
end
return obj.class.name
return obj.class.superclass.name
end

def apply_options_to_scope(scope, options = {})
Expand Down

0 comments on commit c784534

Please sign in to comment.