Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError (undefined method `value' for #<SimpleFeed::Response:...>) when trying to delete_if #22

Open
llukyanov opened this issue Jul 2, 2020 · 3 comments
Assignees
Labels

Comments

@llukyanov
Copy link

llukyanov commented Jul 2, 2020

Hello, I've created a feed and am trying to delete activity from it via the "delete_if" block as described in the docs by comparing against the "value" of an activity, however am getting an undefined method error. Thanks.

@kigster
Copy link
Owner

kigster commented Jul 3, 2020

Could you please paste the block where you are deleting it, and the top five stack strace?

@llukyanov
Copy link
Author

Below is the block. The SimpleFeed is named "Newsfeed" and contains data of the format {:activity_type => (ex. 'posting;), :activity_id=> (ex. 1), :user_id=> (ex. 1)}

	follower = follow_activity.user
	following = follow_activity.following

	follower_feed = SimpleFeed.newsfeed.activity(follower.id)
	follower_feed.delete_if do |event, user_id|
		event.value =~ /\"user_id\"=>#{following.id}/
	end

And here is the strace:

Traceback (most recent call last):
3: from (irb):5
2: from app/lib/newsfeed.rb:94:in update_after_unfollow' 1: from app/lib/newsfeed.rb:95:in block in update_after_unfollow'
NoMethodError (undefined method `value' for #SimpleFeed::Response:0x00007f7f76572680)
Did you mean? values
value?

Thank you!

@kigster
Copy link
Owner

kigster commented Jul 9, 2020

Thanks!

@kigster kigster self-assigned this Jul 26, 2020
@kigster kigster added the broke label Jul 26, 2020
kigster added a commit that referenced this issue Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants