diff --git a/lib/acts_as_follower/follower.rb b/lib/acts_as_follower/follower.rb index a086ebe..16b4259 100644 --- a/lib/acts_as_follower/follower.rb +++ b/lib/acts_as_follower/follower.rb @@ -29,7 +29,8 @@ def follow_count # Does not allow duplicate records to be created. def follow(followable) if self != followable - self.follows.find_or_create_by(followable_id: followable.id, followable_type: parent_class_name(followable)) + params = {followable_id: followable.id, followable_type: parent_class_name(followable)} + self.follows.where(params).first_or_create! end end