foxnewsnetwork/German-Lit155 — Issue #23: Following an area.
Author: trevor-umeda
Created: 2011-10-30 09:17:22+00:00
State: open

Writing down some notes on following an area. Not sure if this is an issue persay but just putting it down.

Should be about 3 tasks to setting this up. All of this assumes a user arbitrarily follows an area they click and not a predefined one. As will be mentioned, we're not following other users, and as such there is not many to many relation. This cuts down on the complexity. As users are mainly anonymous, there should not be any worry about this no matter how we change up are plan.

1. Picking the Area to be followed.
My idea now is to pick a marker thats already been made, and you can then set that as an area you want to follow. As we already have a system for creating rumors by clicking, I don't wanna overlap that by having to click to choose area. If you wanted to follow an area simply by clicking, we can easily reconfigure the create rumor via click as an area will only have latitude and longitude.

2. Creating underlying models and relations.
This should be easy. User will have relation to an "Area" model. Should basically just have a latitude and longitude. This should be simpler then doing a twitter user to user following as there is no need to have a many to many. I can't imagine we need a many to many relationship table, though I could be wrong.

3. Getting a feed.
This may be harder. We'd have to choose where to display and how to. But also the underlying sql. How michael hartl does it is query the the posts/rumors and if it's being followed, select it. With twitter you only need to check if the posts user id is in among the user id's followed. A simple check. With this you'll have to do math to make sure it's in the radius, to be decided, of the followed area. This is still like an O(N) search, but still longer cus of the math so would be slightly longer. Dunno how well this would scale.

The hectic week is over for me so I'll see what I can do on this. Putting down notes so if you jump in you know my train of thought