{"action":"created","issue":{"url":"https://api.github.com/repos/simukappu/activity_notification/issues/92","repository_url":"https://api.github.com/repos/simukappu/activity_notification","labels_url":"https://api.github.com/repos/simukappu/activity_notification/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/simukappu/activity_notification/issues/92/comments","events_url":"https://api.github.com/repos/simukappu/activity_notification/issues/92/events","html_url":"https://github.com/simukappu/activity_notification/issues/92","id":381736053,"node_id":"MDU6SXNzdWUzODE3MzYwNTM=","number":92,"title":"NoMethodError (undefined method 'notification_targets' for #<User:....> question ","user":{"login":"RailsCod3rFuture","id":8632141,"node_id":"MDQ6VXNlcjg2MzIxNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8632141?v=4","gravatar_id":"","url":"https://api.github.com/users/RailsCod3rFuture","html_url":"https://github.com/RailsCod3rFuture","followers_url":"https://api.github.com/users/RailsCod3rFuture/followers","following_url":"https://api.github.com/users/RailsCod3rFuture/following{/other_user}","gists_url":"https://api.github.com/users/RailsCod3rFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/RailsCod3rFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RailsCod3rFuture/subscriptions","organizations_url":"https://api.github.com/users/RailsCod3rFuture/orgs","repos_url":"https://api.github.com/users/RailsCod3rFuture/repos","events_url":"https://api.github.com/users/RailsCod3rFuture/events{/privacy}","received_events_url":"https://api.github.com/users/RailsCod3rFuture/received_events","type":"User","site_admin":false},"labels":[{"id":1035132139,"node_id":"MDU6TGFiZWwxMDM1MTMyMTM5","url":"https://api.github.com/repos/simukappu/activity_notification/labels/need%20more%20info","name":"need more info","color":"083293","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-16T19:47:21Z","updated_at":"2018-11-19T04:53:19Z","closed_at":null,"author_association":"NONE","body":"I'm trying to use **acts_as_follower** with **activity_notification**, but it can't seem to locate the target for the follow. I tried a 3 different methods, but nothing seems to be working.\r\n\r\nhttps://github.com/tcocca/acts_as_follower\r\n\r\n\r\n```\r\nNoMethodError (undefined method `notification_targets' for #<User:0x0000000012dd54e8>\r\nDid you mean?  notification_keys):\r\n  \r\napp/controllers/users_controller.rb:34:in `follow'\r\nProcessing by ExceptionHandler::ExceptionsController#show as JS\r\n  Parameters: {\"id\"=>\"userone\"}\r\nCompleted 500 Internal Server Error in 199ms (ActiveRecord: 0.0ms)\r\n```\r\n\r\n**users_controller.rb**\r\n```\r\n\r\n def follow\r\n    @user = User.find(params[:id])\r\n    current_user.follow(@user)\r\n   # @user.notify :users, key: \"user.followable\"\r\n    ActivityNotification::Notification.notify :users, @user, key: \"user.follow\"\r\n    respond_to do |format|\r\n      format.js {render :action => \"follow\"}\r\n    end\r\n  end\r\n```\r\n\r\n**follow.rb**\r\n\r\n```\r\nclass Follow < ActiveRecord::Base\r\n\r\n  extend ActsAsFollower::FollowerLib\r\n  extend ActsAsFollower::FollowScopes\r\n\r\n  # NOTE: Follows belong to the \"followable\" and \"follower\" interface\r\n  belongs_to :followable, polymorphic: true\r\n  belongs_to :follower, polymorphic: true\r\n\r\n  def activity_actor\r\n    self.follower\r\n  end\r\nend\r\n```\r\n\r\n**user.rb**\r\n\r\n```\r\nclass User < ApplicationRecord\r\n  acts_as_target\r\n  acts_as_followable\r\n  acts_as_messageable\r\n  acts_as_follower\r\nend\r\n\r\n```\r\n\r\nIf possible, can you show me how to group followers."},"comment":{"url":"https://api.github.com/repos/simukappu/activity_notification/issues/comments/439771369","html_url":"https://github.com/simukappu/activity_notification/issues/92#issuecomment-439771369","issue_url":"https://api.github.com/repos/simukappu/activity_notification/issues/92","id":439771369,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTc3MTM2OQ==","user":{"login":"RailsCod3rFuture","id":8632141,"node_id":"MDQ6VXNlcjg2MzIxNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8632141?v=4","gravatar_id":"","url":"https://api.github.com/users/RailsCod3rFuture","html_url":"https://github.com/RailsCod3rFuture","followers_url":"https://api.github.com/users/RailsCod3rFuture/followers","following_url":"https://api.github.com/users/RailsCod3rFuture/following{/other_user}","gists_url":"https://api.github.com/users/RailsCod3rFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/RailsCod3rFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RailsCod3rFuture/subscriptions","organizations_url":"https://api.github.com/users/RailsCod3rFuture/orgs","repos_url":"https://api.github.com/users/RailsCod3rFuture/repos","events_url":"https://api.github.com/users/RailsCod3rFuture/events{/privacy}","received_events_url":"https://api.github.com/users/RailsCod3rFuture/received_events","type":"User","site_admin":false},"created_at":"2018-11-19T04:53:19Z","updated_at":"2018-11-19T04:53:19Z","author_association":"NONE","body":"Is it possible to simply notify through the user object after the follow is successful? Instead of using the follow class? If you know of any work arounds, I would be willing to try them."}}
{"actor":{"display_login":"RailsCod3rFuture"}}